public interface ErrorResponseEnricher
HawaiiResponseEntityExceptionHandler has a list of ErrorResponseEnrichers, which will make sure that
all relevant information is captured in the error response.| Modifier and Type | Method and Description |
|---|---|
void |
doEnrich(ErrorResponseResource errorResponseResource,
Throwable throwable,
WebRequest request,
HttpStatus httpStatus)
Performs the enrichment of the error response resource.
|
default void |
enrich(ErrorResponseResource errorResponseResource,
Throwable throwable,
WebRequest request,
HttpStatus httpStatus)
Default implementation that first translates the original throwable to the one that was used to determine the
error response resource type, i.e.
|
default void enrich(ErrorResponseResource errorResponseResource, Throwable throwable, WebRequest request, HttpStatus httpStatus)
HawaiiException.getCausingHawaiiException(Throwable) and
then calls doEnrich(ErrorResponseResource, Throwable, WebRequest, HttpStatus).
Note that the http status is a given, it is assumed to be determined in the exception handler.errorResponseResource - the error response resourcethrowable - the exception that was raisedrequest - the original web requesthttpStatus - the http status that will be returnedvoid doEnrich(ErrorResponseResource errorResponseResource, Throwable throwable, WebRequest request, HttpStatus httpStatus)
errorResponseResource - the error response resourcethrowable - the exception that was raisedrequest - the original web requesthttpStatus - the http status that will be returned