Package com.linecorp.armeria.server.grpc
Interface UnframedGrpcErrorHandler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Error handler which maps a gRPC response to an
HttpResponse.-
Method Summary
Modifier and TypeMethodDescriptioncom.linecorp.armeria.common.HttpResponsehandle(com.linecorp.armeria.server.ServiceRequestContext ctx, Status status, com.linecorp.armeria.common.AggregatedHttpResponse response) Maps the gRPC error response to theHttpResponse.static UnframedGrpcErrorHandlerof()Returns a plain text or json response based on the content type.static UnframedGrpcErrorHandlerof(UnframedGrpcStatusMappingFunction statusMappingFunction) Returns a plain text or json response based on the content type.static UnframedGrpcErrorHandlerofJson()Returns a json response.static UnframedGrpcErrorHandlerofJson(UnframedGrpcStatusMappingFunction statusMappingFunction) Returns a json response.static UnframedGrpcErrorHandlerReturns a plain text response.static UnframedGrpcErrorHandlerofPlainText(UnframedGrpcStatusMappingFunction statusMappingFunction) Returns a plain text response.
-
Method Details
-
of
Returns a plain text or json response based on the content type. -
of
Returns a plain text or json response based on the content type. -
ofJson
Returns a json response. -
ofJson
Returns a json response. -
ofPlainText
Returns a plain text response. -
ofPlainText
static UnframedGrpcErrorHandler ofPlainText(UnframedGrpcStatusMappingFunction statusMappingFunction) Returns a plain text response. -
handle
com.linecorp.armeria.common.HttpResponse handle(com.linecorp.armeria.server.ServiceRequestContext ctx, Status status, com.linecorp.armeria.common.AggregatedHttpResponse response) Maps the gRPC error response to theHttpResponse.- Parameters:
ctx- the service context.status- the gRPCStatuscode.response- the gRPC response.- Returns:
- the
HttpResponse.
-