Class RequestInfoErrorResponseEnricher
- java.lang.Object
-
- org.hawaiiframework.web.exception.RequestInfoErrorResponseEnricher
-
- All Implemented Interfaces:
ErrorResponseEnricher
public class RequestInfoErrorResponseEnricher extends Object implements ErrorResponseEnricher
This enricher copies information from the original web request onto the error response resource. The enricher captures the following request information:- The request uri
- Query parameters
- The request method
- The requested content type
- Since:
- 2.0.0
- Author:
- Paul Klos
-
-
Constructor Summary
Constructors Constructor Description RequestInfoErrorResponseEnricher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddoEnrich(ErrorResponseResource errorResponseResource, Throwable throwable, org.springframework.web.context.request.WebRequest request, org.springframework.http.HttpStatus httpStatus)Performs the enrichment of the error response resource.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hawaiiframework.web.exception.ErrorResponseEnricher
enrich
-
-
-
-
Method Detail
-
doEnrich
public 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.NOTE: This enricher only applies if the request is a
ServletWebRequest.- Specified by:
doEnrichin interfaceErrorResponseEnricher- Parameters:
errorResponseResource- the error response resourcethrowable- the exception that was raisedrequest- the original web requesthttpStatus- the http status that will be returned
-
-