Package io.quarkus.grpc
Interface ExceptionHandlerProvider
-
public interface ExceptionHandlerProviderProvider for ExceptionHandler. To use a custom ExceptionHandler, extendExceptionHandlerand implement anExceptionHandlerProvider, and expose it as a CDI bean.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description <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.StatustoStatus(Throwable t)Get Status from exception.static ExceptiontoStatusException(Throwable t, boolean runtime)Throw Status exception.static Optional<io.grpc.Metadata>toTrailers(Throwable t)Get optional Metadata from exception.default Throwabletransform(Throwable t)
-
-
-
Method Detail
-
createHandler
<ReqT,RespT> ExceptionHandler<ReqT,RespT> createHandler(io.grpc.ServerCall.Listener<ReqT> listener, io.grpc.ServerCall<ReqT,RespT> serverCall, io.grpc.Metadata metadata)
-
toStatusException
static Exception toStatusException(Throwable t, boolean runtime)
Throw Status exception.- Parameters:
t- the throwable to transformruntime- true if we should throw StatusRuntimeException, false for StatusException- Returns:
- Status(Runtime)Exception
-
toStatus
static io.grpc.Status toStatus(Throwable t)
Get Status from exception.- Parameters:
t- the throwable to read or create status from- Returns:
- gRPC Status instance
-
-