Class SpringMvcExceptionHandler

java.lang.Object
org.frankframework.console.exceptions.SpringMvcExceptionHandler

@RestControllerAdvice @Order(-2147483548) public class SpringMvcExceptionHandler extends Object
Taken partially from ResponseEntityExceptionHandler.handleException(Exception, WebRequest). This ExceptionHandler catches Spring HTTP related MVC exceptions, as well as IO related exceptions. Catch all Spring web exceptions (such as subclasses of ServletException), even when they are not thrown from our own sources. We need to prioritize this so our handler is used before Spring's own ExceptionHandler.
  • Constructor Details

    • SpringMvcExceptionHandler

      public SpringMvcExceptionHandler()
  • Method Details

    • handleException

      @ExceptionHandler({org.springframework.web.bind.MethodArgumentNotValidException.class,org.springframework.web.context.request.async.AsyncRequestTimeoutException.class,org.springframework.web.ErrorResponseException.class,org.springframework.web.multipart.MaxUploadSizeExceededException.class,jakarta.servlet.ServletException.class}) protected final org.springframework.http.ResponseEntity<Object> handleException(Exception ex)
      These Exceptions all implement ErrorResponse so they come pre-configured with a status-code and headers.
    • handleExceptionLowLevel

      @ExceptionHandler({org.springframework.beans.ConversionNotSupportedException.class,org.springframework.beans.TypeMismatchException.class,org.springframework.http.converter.HttpMessageNotReadableException.class,org.springframework.http.converter.HttpMessageNotWritableException.class,org.springframework.validation.method.MethodValidationException.class,org.springframework.validation.BindException.class}) protected final org.springframework.http.ResponseEntity<Object> handleExceptionLowLevel(Exception ex)
      Lower level bean-exceptions
    • handleNoHandlerFoundException

      @ExceptionHandler(org.springframework.web.servlet.NoHandlerFoundException.class) protected org.springframework.http.ResponseEntity<Object> handleNoHandlerFoundException(org.springframework.web.servlet.NoHandlerFoundException ex)
      When a RestController cannot be found, Spring MVC throws this Exception.
    • handleSpringException

      protected org.springframework.http.ResponseEntity<Object> handleSpringException(Exception exception, org.springframework.http.HttpStatusCode status, @Nullable org.springframework.http.HttpHeaders headers)