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 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

      default Throwable transform(Throwable t)
    • toStatusException

      static Exception toStatusException(Throwable t, boolean runtime)
      Throw Status exception.
      Parameters:
      t - the throwable to transform
      runtime - 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
    • toTrailers

      static Optional<io.grpc.Metadata> toTrailers(Throwable t)
      Get optional Metadata from exception.
      Parameters:
      t - the throwable to read or create metadata from
      Returns:
      optional gRPC Metadata instance