@Override public Server server() { return delegate().server(); }
if (cause != null) { final HttpResponse errorRes; if (ctx.server().config().verboseResponses()) { errorRes = HttpResponse.of(HttpStatus.INTERNAL_SERVER_ERROR, MediaType.PLAIN_TEXT_UTF_8,
static HttpHeaders statusToTrailers(ServiceRequestContext ctx, Status status, boolean headersSent) { final HttpHeaders trailers; if (headersSent) { // Normal trailers. trailers = new DefaultHttpHeaders(); } else { // Trailers only response trailers = new DefaultHttpHeaders(true, 3, true) .status(HttpStatus.OK) .set(HttpHeaderNames.CONTENT_TYPE, "application/grpc+proto"); } trailers.add(GrpcHeaderNames.GRPC_STATUS, Integer.toString(status.getCode().value())); if (status.getDescription() != null) { trailers.add(GrpcHeaderNames.GRPC_MESSAGE, StatusMessageEscaper.escape(status.getDescription())); } if (ctx.server().config().verboseResponses() && status.getCause() != null) { final ThrowableProto proto = GrpcStatus.serializeThrowable(status.getCause()); trailers.add(GrpcHeaderNames.ARMERIA_GRPC_THROWABLEPROTO_BIN, Base64.getEncoder().encodeToString(proto.toByteArray())); } return trailers; }
appException = (TApplicationException) cause; } else { if (ctx.server().config().verboseResponses()) { appException = new TApplicationException( TApplicationException.INTERNAL_ERROR,
if (ctx.server().config().verboseResponses()) { errorRes = HttpResponse.of(HttpStatus.BAD_REQUEST, MediaType.PLAIN_TEXT_UTF_8, "Failed to decode a %s header: %s", serializationFormat,
if (cause != null) { final HttpResponse errorRes; if (ctx.server().config().verboseResponses()) { errorRes = HttpResponse.of(HttpStatus.INTERNAL_SERVER_ERROR, MediaType.PLAIN_TEXT_UTF_8,
static HttpHeaders statusToTrailers(ServiceRequestContext ctx, Status status, boolean headersSent) { final HttpHeaders trailers; if (headersSent) { // Normal trailers. trailers = new DefaultHttpHeaders(); } else { // Trailers only response trailers = new DefaultHttpHeaders(true, 3, true) .status(HttpStatus.OK) .set(HttpHeaderNames.CONTENT_TYPE, "application/grpc+proto"); } trailers.add(GrpcHeaderNames.GRPC_STATUS, Integer.toString(status.getCode().value())); if (status.getDescription() != null) { trailers.add(GrpcHeaderNames.GRPC_MESSAGE, StatusMessageEscaper.escape(status.getDescription())); } if (ctx.server().config().verboseResponses() && status.getCause() != null) { final ThrowableProto proto = GrpcStatus.serializeThrowable(status.getCause()); trailers.add(GrpcHeaderNames.ARMERIA_GRPC_THROWABLEPROTO_BIN, Base64.getEncoder().encodeToString(proto.toByteArray())); } return trailers; }
if (cause != null) { final HttpResponse errorRes; if (ctx.server().config().verboseResponses()) { errorRes = HttpResponse.of(HttpStatus.INTERNAL_SERVER_ERROR, MediaType.PLAIN_TEXT_UTF_8,
appException = (TApplicationException) cause; } else { if (ctx.server().config().verboseResponses()) { appException = new TApplicationException( TApplicationException.INTERNAL_ERROR,
appException = (TApplicationException) cause; } else { if (ctx.server().config().verboseResponses()) { appException = new TApplicationException( TApplicationException.INTERNAL_ERROR,
if (ctx.server().config().verboseResponses()) { errorRes = HttpResponse.of(HttpStatus.BAD_REQUEST, MediaType.PLAIN_TEXT_UTF_8, "Failed to decode a %s header: %s", serializationFormat,
if (ctx.server().config().verboseResponses()) { errorRes = HttpResponse.of(HttpStatus.BAD_REQUEST, MediaType.PLAIN_TEXT_UTF_8, "Failed to decode a %s header: %s", serializationFormat,