Class BaseRestExceptionHandlers

java.lang.Object
org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
org.craftercms.commons.rest.BaseRestExceptionHandlers
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.MessageSourceAware
Direct Known Subclasses:
ValidationAwareRestExceptionHandlers

@ControllerAdvice public class BaseRestExceptionHandlers extends org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
Class that provides the basic ExceptionHandlers for Crafter REST services.
Author:
avasquez
  • Field Summary

    Fields inherited from class org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler

    PAGE_NOT_FOUND_LOG_CATEGORY, pageNotFoundLogger
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.springframework.http.ResponseEntity<Object>
    handleExceptionInternal(Exception ex, Object body, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatusCode statusCode, org.springframework.web.context.request.WebRequest request)
     
    protected org.springframework.http.ResponseEntity<Object>
    handleExceptionInternal(Exception ex, String message, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatus status, org.springframework.web.context.request.WebRequest request)
     
    org.springframework.http.ResponseEntity<Object>
    handleGeneralException(Exception ex, org.springframework.web.context.request.WebRequest webRequest)
     

    Methods inherited from class org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler

    createProblemDetail, createResponseEntity, getMessageSource, handleAsyncRequestNotUsableException, handleAsyncRequestTimeoutException, handleConversionNotSupported, handleErrorResponseException, handleException, handleHandlerMethodValidationException, handleHttpMediaTypeNotAcceptable, handleHttpMediaTypeNotSupported, handleHttpMessageNotReadable, handleHttpMessageNotWritable, handleHttpRequestMethodNotSupported, handleMaxUploadSizeExceededException, handleMethodArgumentNotValid, handleMethodValidationException, handleMissingPathVariable, handleMissingServletRequestParameter, handleMissingServletRequestPart, handleNoHandlerFoundException, handleNoResourceFoundException, handleServletRequestBindingException, handleTypeMismatch, setMessageSource

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BaseRestExceptionHandlers

      public BaseRestExceptionHandlers()
  • Method Details

    • handleGeneralException

      @ExceptionHandler(java.lang.Exception.class) public org.springframework.http.ResponseEntity<Object> handleGeneralException(Exception ex, org.springframework.web.context.request.WebRequest webRequest)
    • handleExceptionInternal

      protected org.springframework.http.ResponseEntity<Object> handleExceptionInternal(Exception ex, String message, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatus status, org.springframework.web.context.request.WebRequest request)
    • handleExceptionInternal

      protected org.springframework.http.ResponseEntity<Object> handleExceptionInternal(Exception ex, @Nullable Object body, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatusCode statusCode, org.springframework.web.context.request.WebRequest request)
      Overrides:
      handleExceptionInternal in class org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler