Class GenericErrorHandler

java.lang.Object
nl._42.restsecure.autoconfigure.errorhandling.GenericErrorHandler

@Component public class GenericErrorHandler extends Object
REST errorhandler that sets given http status and writes given errorCode as custom property in the RFC-7078 json object to the http response. Json example: { errorCode: 'server.error'}
  • Constructor Details

    • GenericErrorHandler

      public GenericErrorHandler(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
  • Method Details

    • respond

      public void respond(jakarta.servlet.http.HttpServletResponse response, org.springframework.http.HttpStatus status, String errorCode) throws IOException
      Throws:
      IOException