Class ErrorConfiguration
- java.lang.Object
-
- edu.cnm.deepdive.tunefull.configuration.ErrorConfiguration
-
@RestControllerAdvice public class ErrorConfiguration extends java.lang.ObjectErrorConfigurationprovides methods both to handle errors that would result in an HTTP 500 response status and to translate other responses to the desired response status code.- Since:
- 1.0
- Version:
- 1.0
- Author:
- Robert Dominugez, Roderick Frechette, Laura Steiner
-
-
Constructor Summary
Constructors Constructor Description ErrorConfiguration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbadRequest()ChangesIllegalArgumentExceptioninto a400 Bad Requestresponse.voidnotFound()ChangesNoSuchElementExceptioninto a404 Not Foundresponse.
-
-
-
Method Detail
-
notFound
@ExceptionHandler(java.util.NoSuchElementException.class) @ResponseStatus(value=NOT_FOUND, reason="Resource not found or moved") public void notFound()ChangesNoSuchElementExceptioninto a404 Not Foundresponse.
-
badRequest
@ExceptionHandler(java.lang.IllegalArgumentException.class) @ResponseStatus(value=BAD_REQUEST, reason="Empty request body or invalid information") public void badRequest()ChangesIllegalArgumentExceptioninto a400 Bad Requestresponse.
-
-