Package com.linecorp.armeria.common.grpc
Interface GrpcExceptionHandlerFunction
- All Known Subinterfaces:
GoogleGrpcExceptionHandlerFunction
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
An interface that converts a
Throwable
into a gRPC Status
for gRPC exception handler.-
Method Summary
Modifier and TypeMethodDescription@Nullable io.grpc.Status
apply
(RequestContext ctx, Throwable cause, io.grpc.Metadata metadata) builder()
Returns a newly createdGrpcExceptionHandlerFunctionBuilder
.default GrpcExceptionHandlerFunction
Returns aGrpcExceptionHandlerFunction
that returns the result of this function when this function returns nonnull
result, in which case the specified function isn't executed.
-
Method Details
-
builder
Returns a newly createdGrpcExceptionHandlerFunctionBuilder
. -
apply
@Nullable @Nullable io.grpc.Status apply(RequestContext ctx, Throwable cause, io.grpc.Metadata metadata) Maps the specifiedThrowable
to a gRPCStatus
, and mutates the specifiedMetadata
. Ifnull
is returned, the built-in mapping rule is used by default. -
orElse
Returns aGrpcExceptionHandlerFunction
that returns the result of this function when this function returns nonnull
result, in which case the specified function isn't executed. when this function returnsnull
, returns aGrpcExceptionHandlerFunction
that the result of the specifiedGrpcExceptionHandlerFunction
.
-