Interface ErrorResponse.Interceptor
- Enclosing interface:
ErrorResponse
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Callback to perform an action before an RFC-9457
ProblemDetail
response is rendered.
Implementations that need the current request, for example to read
request headers or parameters, can override
handleError(ProblemDetail, ErrorResponse, HttpRequest).
- Since:
- 6.2
- Author:
- Rossen Stoyanchev
-
Method Summary
Modifier and TypeMethodDescriptionvoidhandleError(ProblemDetail detail, @Nullable ErrorResponse errorResponse) Handle the givenProblemDetailthat's going to be rendered, and theErrorResponseit originates from, if applicable.default voidhandleError(ProblemDetail detail, @Nullable ErrorResponse errorResponse, HttpRequest request) Variant ofhandleError(ProblemDetail, ErrorResponse)with access to the current request.
-
Method Details
-
handleError
Handle the givenProblemDetailthat's going to be rendered, and theErrorResponseit originates from, if applicable.- Parameters:
detail- theProblemDetailto be renderederrorResponse- theErrorResponse, ornullif there isn't one
-
handleError
default void handleError(ProblemDetail detail, @Nullable ErrorResponse errorResponse, HttpRequest request) Variant ofhandleError(ProblemDetail, ErrorResponse)with access to the current request.This is the method invoked by the framework. By default, it delegates to
handleError(ProblemDetail, ErrorResponse).- Parameters:
detail- theProblemDetailto be renderederrorResponse- theErrorResponse, ornullif there isn't onerequest- the current HTTP request- Since:
- 7.1
-