@ControllerAdvice public class SpringExceptionMapper extends AbstractExceptionMapper<SpringExceptionMapper>
ControllerAdvice mechanic.
This handler catches all Throwables, logs them on the server side, and fills the response with the status
code and error description. To change/override this behavior either use the methods defined in the
AbstractExceptionMapper, or write a custom mapper with the ControllerAdvice annotation and a
Priority higher then the default one.
Note that CloudLoggerFactory is not used here to avoid recursion.
| Constructor and Description |
|---|
SpringExceptionMapper() |
| Modifier and Type | Method and Description |
|---|---|
String |
handleException(Throwable t,
javax.servlet.http.HttpServletResponse response)
Logs the
Throwable and fills the HttpServletResponse with the status code and description
provided by the ResponseBuilder. |
getResponseBuilder, logAsError, logAsInfo, logAsLevel, logAsWarning, removeMapping, withMapper, withMapper@ExceptionHandler @ResponseBody public String handleException(Throwable t, javax.servlet.http.HttpServletResponse response)
Throwable and fills the HttpServletResponse with the status code and description
provided by the ResponseBuilder.t - The Throwable to handle.response - The HttpServletResponse to be filled with the status code and description.HttpServletResponse.Copyright © 2018 SAP SE. All rights reserved.