final AggregatedHttpResponse toAggregatedHttpResponse(HttpStatusException cause) {
        final HttpStatus status = cause.httpStatus();
        final Throwable cause0 = firstNonNull(cause.getCause(), cause);
        final ServiceConfig serviceConfig = reqCtx.config();
        final AggregatedHttpResponse response = serviceConfig.errorHandler()
                                                             .renderStatus(reqCtx, req.headers(), status,
                                                                           null, cause0);
        assert response != null;
        return response;
    }
Writes the {@link AggregatedHttpResponse} to the {@link Channel}.
Note that the caller has to flush the written data when needed.
core/src/main/java/com/linecorp/armeria/server/AbstractHttpResponseHandler.java