Class ExceptionHandlingWebHandler
java.lang.Object
org.springframework.web.server.handler.WebHandlerDecorator
org.springframework.web.server.handler.ExceptionHandlingWebHandler
- All Implemented Interfaces:
WebHandler
WebHandler decorator that invokes one or more
WebExceptionHandlers
after the delegate WebHandler
.- Since:
- 5.0
- Author:
- Rossen Stoyanchev
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Name of theattribute
that contains the exception handled byWebExceptionHandlers
. -
Constructor Summary
ConstructorDescriptionExceptionHandlingWebHandler
(WebHandler delegate, List<WebExceptionHandler> handlers) Create anExceptionHandlingWebHandler
for the given delegate. -
Method Summary
Modifier and TypeMethodDescriptionReturn a read-only list of the configured exception handlers.reactor.core.publisher.Mono<Void>
handle
(ServerWebExchange exchange) Handle the web server exchange.Methods inherited from class org.springframework.web.server.handler.WebHandlerDecorator
getDelegate, toString
-
Field Details
-
HANDLED_WEB_EXCEPTION
Name of theattribute
that contains the exception handled byWebExceptionHandlers
.- Since:
- 6.1
-
-
Constructor Details
-
ExceptionHandlingWebHandler
Create anExceptionHandlingWebHandler
for the given delegate.- Parameters:
delegate
- the WebHandler delegatehandlers
- the WebExceptionHandlers to apply
-
-
Method Details
-
getExceptionHandlers
Return a read-only list of the configured exception handlers. -
handle
Description copied from interface:WebHandler
Handle the web server exchange.- Specified by:
handle
in interfaceWebHandler
- Overrides:
handle
in classWebHandlerDecorator
- Parameters:
exchange
- the current server exchange- Returns:
Mono<Void>
to indicate when request handling is complete
-