Package cvut.fel.controller.config
Class RestResponseEntityExceptionHandler
java.lang.Object
org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
cvut.fel.controller.config.RestResponseEntityExceptionHandler
@ControllerAdvice
public class RestResponseEntityExceptionHandler
extends org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
FIELD_INVALID
static java.lang.String
FIELD_MISSING
static java.lang.String
FIELD_TOO_LONG
-
Constructor Summary
Constructors Constructor Description RestResponseEntityExceptionHandler()
-
Method Summary
Modifier and Type Method Description protected org.springframework.http.ResponseEntity<java.lang.Object>
handleFieldInvalidException(FieldInvalidException ex)
protected org.springframework.http.ResponseEntity<java.lang.Object>
handleFieldMissingException(FieldMissingException ex)
protected org.springframework.http.ResponseEntity<java.lang.Object>
handleFieldTooLongException(FieldTooLongException ex)
protected org.springframework.http.ResponseEntity<java.lang.Object>
handleMethodArgumentNotValid(org.springframework.web.bind.MethodArgumentNotValidException ex, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatus status, org.springframework.web.context.request.WebRequest request)
protected org.springframework.http.ResponseEntity<java.lang.Object>
handleNotFoundException(NotFoundException ex)
Methods inherited from class org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
handleAsyncRequestTimeoutException, handleBindException, handleConversionNotSupported, handleException, handleExceptionInternal, handleHttpMediaTypeNotAcceptable, handleHttpMediaTypeNotSupported, handleHttpMessageNotReadable, handleHttpMessageNotWritable, handleHttpRequestMethodNotSupported, handleMissingPathVariable, handleMissingServletRequestParameter, handleMissingServletRequestPart, handleNoHandlerFoundException, handleServletRequestBindingException, handleTypeMismatch
-
Field Details
-
FIELD_MISSING
public static final java.lang.String FIELD_MISSING- See Also:
- Constant Field Values
-
FIELD_INVALID
public static final java.lang.String FIELD_INVALID- See Also:
- Constant Field Values
-
FIELD_TOO_LONG
public static final java.lang.String FIELD_TOO_LONG- See Also:
- Constant Field Values
-
-
Constructor Details
-
RestResponseEntityExceptionHandler
public RestResponseEntityExceptionHandler()
-
-
Method Details
-
handleNotFoundException
@ExceptionHandler(NotFoundException.class) protected org.springframework.http.ResponseEntity<java.lang.Object> handleNotFoundException(NotFoundException ex) -
handleFieldMissingException
@ExceptionHandler(FieldMissingException.class) protected org.springframework.http.ResponseEntity<java.lang.Object> handleFieldMissingException(FieldMissingException ex) -
handleFieldInvalidException
@ExceptionHandler(FieldInvalidException.class) protected org.springframework.http.ResponseEntity<java.lang.Object> handleFieldInvalidException(FieldInvalidException ex) -
handleFieldTooLongException
@ExceptionHandler(FieldTooLongException.class) protected org.springframework.http.ResponseEntity<java.lang.Object> handleFieldTooLongException(FieldTooLongException ex) -
handleMethodArgumentNotValid
protected org.springframework.http.ResponseEntity<java.lang.Object> handleMethodArgumentNotValid(org.springframework.web.bind.MethodArgumentNotValidException ex, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatus status, org.springframework.web.context.request.WebRequest request)- Overrides:
handleMethodArgumentNotValid
in classorg.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
-