Package io.quarkus.grpc
Interface ExceptionHandlerProvider
public interface ExceptionHandlerProvider
Provider for ExceptionHandler.
To use a custom ExceptionHandler, extend
ExceptionHandler and implement
an ExceptionHandlerProvider, and expose it as a CDI bean.-
Method Summary
Modifier and TypeMethodDescription<ReqT,RespT>
ExceptionHandler<ReqT,RespT> createHandler(io.grpc.ServerCall.Listener<ReqT> listener, io.grpc.ServerCall<ReqT, RespT> serverCall, io.grpc.Metadata metadata) static io.grpc.StatusGet Status from exception.static ExceptiontoStatusException(Throwable t, boolean runtime) Throw Status exception.static Optional<io.grpc.Metadata>Get optional Metadata from exception.default Throwable
-
Method Details
-
createHandler
<ReqT,RespT> ExceptionHandler<ReqT,RespT> createHandler(io.grpc.ServerCall.Listener<ReqT> listener, io.grpc.ServerCall<ReqT, RespT> serverCall, io.grpc.Metadata metadata) -
transform
-
toStatusException
Throw Status exception.- Parameters:
t- the throwable to transformruntime- true if we should throw StatusRuntimeException, false for StatusException- Returns:
- Status(Runtime)Exception
-
toStatus
Get Status from exception.- Parameters:
t- the throwable to read or create status from- Returns:
- gRPC Status instance
-
toTrailers
Get optional Metadata from exception.- Parameters:
t- the throwable to read or create metadata from- Returns:
- optional gRPC Metadata instance
-