public static void addStatusMessageToTrailers(
            HttpHeadersBuilder trailersBuilder, int code, @Nullable String message,
            @Nullable byte[] details) {
        trailersBuilder.endOfStream(true);
        trailersBuilder.add(GrpcHeaderNames.GRPC_STATUS, StringUtil.toString(code));
        if (message != null) {
            trailersBuilder.add(GrpcHeaderNames.GRPC_MESSAGE, StatusMessageEscaper.escape(message));
        }
        if (details != null && details.length > 0) {
            final String encodedDetails = Base64.getEncoder().encodeToString(details);
            trailersBuilder.add(GrpcHeaderNames.GRPC_STATUS_DETAILS_BIN, encodedDetails);
        }
    }
Adds the given gRPC status code, and optionally an error message, to the specified
{@link HttpHeadersBuilder}. This will also set the {@code endOfStream} of the {@link HttpHeadersBuilder}
as {@code true}.
grpc-protocol/src/main/java/com/linecorp/armeria/internal/common/grpc/protocol/GrpcTrailersUtil.java