JavaScript is disabled on your browser.
java.lang.Object
org.springframework.boot.autoconfigure.web.reactive.error.AbstractErrorWebExceptionHandler
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods
Modifier and Type
Method and Description
void
afterPropertiesSet ()
protected Throwable
getError (ServerRequest request)
Extract the original error from the current request.
protected Map <String ,Object >
getErrorAttributes (ServerRequest request,
boolean includeStackTrace)
Extract the error attributes from the current request, to be used to populate error
views or JSON payloads.
protected abstract RouterFunction <ServerResponse >
getRoutingFunction (ErrorAttributes errorAttributes)
Create a
RouterFunction
that can route and handle errors as JSON responses
or HTML views.
reactor.core.publisher.Mono<Void >
handle (ServerWebExchange exchange,
Throwable throwable)
protected boolean
isTraceEnabled (ServerRequest request)
Check whether the trace attribute has been set on the given request.
protected reactor.core.publisher.Mono<ServerResponse >
renderDefaultErrorView (ServerResponse.BodyBuilder responseBody,
Map <String ,Object > error)
Render a default HTML "Whitelabel Error Page".
protected reactor.core.publisher.Mono<ServerResponse >
renderErrorView (String viewName,
ServerResponse.BodyBuilder responseBody,
Map <String ,Object > error)
Render the given error data as a view, using a template view if available or a
static HTML file if available otherwise.
void
setMessageReaders (List <HttpMessageReader <?>> messageReaders)
Configure HTTP message readers to deserialize the request body with.
void
setMessageWriters (List <HttpMessageWriter <?>> messageWriters)
Configure HTTP message writers to serialize the response body with.
void
setViewResolvers (List <ViewResolver > viewResolvers)
Methods inherited from class java.lang.Object
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
Method Detail
getErrorAttributes
protected Map <String ,Object > getErrorAttributes(ServerRequest request,
boolean includeStackTrace)
Extract the error attributes from the current request, to be used to populate error
views or JSON payloads.
Parameters:
request
- the source request
includeStackTrace
- whether to include the error stacktrace information
Returns:
the error attributes as a Map.
renderErrorView
protected reactor.core.publisher.Mono<ServerResponse > renderErrorView(String viewName,
ServerResponse.BodyBuilder responseBody,
Map <String ,Object > error)
Render the given error data as a view, using a template view if available or a
static HTML file if available otherwise. This will return an empty
Publisher
if none of the above are available.
Parameters:
viewName
- the view name
responseBody
- the error response being built
error
- the error data as a map
Returns:
a Publisher of the ServerResponse