Interface ErrorResponseEnricher

    • Method Detail

      • enrich

        default void enrich​(ErrorResponseResource errorResponseResource,
                            org.springframework.web.context.request.WebRequest request,
                            org.springframework.http.HttpStatus httpStatus)
        Default implementation that first retrieves the original throwable stored in the error response resource, 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.
        Parameters:
        errorResponseResource - the error response resource
        request - the original web request
        httpStatus - the http status that will be returned
      • doEnrich

        void doEnrich​(ErrorResponseResource errorResponseResource,
                      Throwable throwable,
                      org.springframework.web.context.request.WebRequest request,
                      org.springframework.http.HttpStatus httpStatus)
        Performs the enrichment of the error response resource. Note that the http status is a given, it is assumed to be determined in the exception handler.
        Parameters:
        errorResponseResource - the error response resource
        throwable - the exception that was raised
        request - the original web request
        httpStatus - the http status that will be returned