@Nullable
    @Override
    public HttpResponse onServiceException(ServiceRequestContext ctx, Throwable cause) {
        final CorsService corsService = ctx.findService(CorsService.class);
        if (shouldSetCorsHeaders(corsService, ctx)) {
            assert corsService != null;
            ctx.mutateAdditionalResponseHeaders(builder -> {
                CorsHeaderUtil.setCorsResponseHeaders(ctx, ctx.request(), builder, corsService.config());
            });
        }
        return serverErrorHandler.onServiceException(ctx, cause);
    }
Constructs a new {@link CorsServerErrorHandler} instance with a specified {@link ServerErrorHandler}.
This handler is used to delegate server error handling for CORS-related errors.

@param serverErrorHandler The {@link ServerErrorHandler} to be used for handling server errors.
core/src/main/java/com/linecorp/armeria/server/CorsServerErrorHandler.java