@Nonnull
    @Override
    public AggregatedHttpResponse renderStatus(@Nullable ServiceRequestContext ctx,
                                               ServiceConfig config,
                                               @Nullable RequestHeaders headers,
                                               HttpStatus status,
                                               @Nullable String description,
                                               @Nullable Throwable cause) {
        if (status.isContentAlwaysEmpty()) {
            return AggregatedHttpResponse.of(ResponseHeaders.of(status));
        }

        final HttpData content;
        try (TemporaryThreadLocals ttl = TemporaryThreadLocals.acquire()) {
            final StringBuilder buf = ttl.stringBuilder();
            buf.append("Status: ").append(status.codeAsText()).append('\n');
            buf.append("Description: ").append(firstNonNull(description, status.reasonPhrase())).append('\n');
            if (cause != null && config.verboseResponses() && !status.isSuccess()) {
                buf.append("Stack trace:\n");
                buf.append(Exceptions.traceText(cause));
            }
            content = HttpData.ofUtf8(buf);
        }

        return AggregatedHttpResponse.of(status, MediaType.PLAIN_TEXT_UTF_8, content);
    }
Converts the specified {@link Throwable} to an {@link HttpResponse}.
core/src/main/java/com/linecorp/armeria/server/DefaultServerErrorHandler.java