@Override
    public HttpResponse serve(ServiceRequestContext ctx, HttpRequest req) throws Exception {
        if (!defaultHttpHeaders.isEmpty()) {
            ctx.mutateAdditionalResponseHeaders(mutator -> mutator.add(defaultHttpHeaders));
        }
        if (!defaultHttpTrailers.isEmpty()) {
            ctx.mutateAdditionalResponseTrailers(mutator -> mutator.add(defaultHttpTrailers));
        }

        final HttpResponse response = serve0(ctx, req);

        if (exceptionHandler == null) {
            // If an error occurs, the default ExceptionHandler will handle the error.
            if (Flags.annotatedServiceExceptionVerbosity() == ExceptionVerbosity.ALL &&
                logger.isWarnEnabled()) {
                return response.peekError(cause -> {
                    logger.warn("{} Exception raised by method '{}' in '{}':",
                                ctx, methodName(), object.getClass().getSimpleName(), Exceptions.peel(cause));
                });
            }
        }

        return response;
    }
An {@link HttpService} which is defined by a {@link Path} or HTTP method annotations.
This class is not supposed to be instantiated by a user. Please check out the documentation
<a href="https://armeria.dev/docs/server-annotated-service">Annotated HTTP Service</a> to use this.
core/src/main/java/com/linecorp/armeria/internal/server/annotation/DefaultAnnotatedService.java