Package org.springframework.web.server.handler

# Class ExceptionHandlingWebHandler

java.lang.Object
org.springframework.web.server.handler.WebHandlerDecorator
org.springframework.web.server.handler.ExceptionHandlingWebHandler

All Implemented Interfaces:
  `WebHandler`

public class ExceptionHandlingWebHandler extends WebHandlerDecorator
WebHandler decorator that invokes one or more `WebExceptionHandlers` after the delegate `WebHandler`.

Since:
  5.0
Author:
  Rossen Stoyanchev

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`HANDLED_WEB_EXCEPTION`
Name of the `attribute` that contains the exception handled by `WebExceptionHandlers`.

## Constructor Summary

Constructors
Constructor
Description
`ExceptionHandlingWebHandler(WebHandler delegate, List<WebExceptionHandler> handlers)`
Create an `ExceptionHandlingWebHandler` for the given delegate.

## Method Summary

Modifier and Type
Method
Description
`List<WebExceptionHandler>`
`getExceptionHandlers()`
Return 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`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### HANDLED_WEB_EXCEPTION

public static final String HANDLED_WEB_EXCEPTION
Name of the `attribute` that contains the exception handled by `WebExceptionHandlers`.

Since:
  6.1

## Constructor Details

### ExceptionHandlingWebHandler

public ExceptionHandlingWebHandler(WebHandler delegate, List<WebExceptionHandler> handlers)
Create an `ExceptionHandlingWebHandler` for the given delegate.

Parameters:
  `delegate` - the WebHandler delegate
  `handlers` - the WebExceptionHandlers to apply

## Method Details

### getExceptionHandlers

public List<WebExceptionHandler> getExceptionHandlers()
Return a read-only list of the configured exception handlers.

### handle

public reactor.core.publisher.Mono<Void> handle(ServerWebExchange exchange)
Description copied from interface: `WebHandler`
Handle the web server exchange.

Specified by:
  `handle` in interface `WebHandler`
Overrides:
  `handle` in class `WebHandlerDecorator`
Parameters:
  `exchange` - the current server exchange
Returns:
  `Mono<Void>` to indicate when request handling is complete