public static HttpStatus grpcStatusToHttpStatus(ServiceRequestContext ctx, Status grpcStatus) {
        if (grpcStatus.getCode() == Code.CANCELLED) {
            final RequestLog log = ctx.log().getIfAvailable(RequestLogProperty.RESPONSE_CAUSE);
            if (log != null) {
                final Throwable responseCause = log.responseCause();
                if (responseCause != null && (responseCause instanceof RequestTimeoutException ||
                                              (responseCause.getCause() instanceof RequestTimeoutException))) {
                    // A call was closed by a server-side timeout.
                    return HttpStatus.SERVICE_UNAVAILABLE;
                }
            }
            // TODO(minwoox): Do not rely on the message to determine the cause of cancellation.
            if ("Completed without a response".equals(grpcStatus.getDescription())) {
                // A unary call was closed without sending a response.
                return HttpStatus.INTERNAL_SERVER_ERROR;
            }
        }
        return grpcCodeToHttpStatus(grpcStatus.getCode());
    }
Maps gRPC {@link Status} to {@link HttpStatus}. If there is no matched rule for the specified
{@link Status}, the mapping rules defined in upstream Google APIs
<a href="https://github.com/googleapis/googleapis/blob/b2a7d2709887e38bcd3b5142424e563b0b386b6f/google/rpc/code.proto">
code.proto</a> will be used to convert the {@linkplain Status#getCode() gRPC code} to
the {@link HttpStatus}.
grpc/src/main/java/com/linecorp/armeria/internal/common/grpc/GrpcStatus.java