@RestControllerAdvice public class ExceptionHandlers extends Object
| Constructor and Description |
|---|
ExceptionHandlers() |
| Modifier and Type | Method and Description |
|---|---|
ErrorInfo |
badRequest(javax.servlet.http.HttpServletRequest req,
IllegalArgumentException ex) |
ErrorInfo |
conflict(javax.servlet.http.HttpServletRequest req,
EntityAlreadyExistsException ex) |
ErrorInfo |
malformedJSON(javax.servlet.http.HttpServletRequest req,
org.springframework.http.converter.HttpMessageNotReadableException ex) |
ErrorInfo |
methodArgumentNotValid(javax.servlet.http.HttpServletRequest req,
Exception ex) |
ErrorInfo |
methodArgumentNotValid(javax.servlet.http.HttpServletRequest req,
org.springframework.web.bind.MethodArgumentNotValidException ex) |
ErrorInfo |
notFound(javax.servlet.http.HttpServletRequest req,
Exception ex) |
ErrorInfo |
otherErrors(javax.servlet.http.HttpServletRequest req) |
ErrorInfo |
sqlErrors(javax.servlet.http.HttpServletRequest req) |
@ExceptionHandler(value={EntityDoesNotExistException.class,org.springframework.web.servlet.NoHandlerFoundException.class})
@ResponseStatus(value=NOT_FOUND)
@ResponseBody
public ErrorInfo notFound(javax.servlet.http.HttpServletRequest req,
Exception ex)
@ExceptionHandler(value=EntityAlreadyExistsException.class) @ResponseStatus(value=CONFLICT) @ResponseBody public ErrorInfo conflict(javax.servlet.http.HttpServletRequest req, EntityAlreadyExistsException ex)
@ExceptionHandler(value={AccessDataBaseException.class,java.sql.SQLException.class})
@ResponseStatus(value=INTERNAL_SERVER_ERROR)
@ResponseBody
public ErrorInfo sqlErrors(javax.servlet.http.HttpServletRequest req)
@ExceptionHandler(value=java.lang.Exception.class) @ResponseStatus(value=INTERNAL_SERVER_ERROR) @ResponseBody public ErrorInfo otherErrors(javax.servlet.http.HttpServletRequest req)
@ExceptionHandler(value=java.lang.IllegalArgumentException.class) @ResponseStatus(value=BAD_REQUEST) @ResponseBody public ErrorInfo badRequest(javax.servlet.http.HttpServletRequest req, IllegalArgumentException ex)
@ExceptionHandler(value=org.springframework.http.converter.HttpMessageNotReadableException.class) @ResponseStatus(value=BAD_REQUEST) @ResponseBody public ErrorInfo malformedJSON(javax.servlet.http.HttpServletRequest req, org.springframework.http.converter.HttpMessageNotReadableException ex)
@ExceptionHandler(value={org.springframework.beans.TypeMismatchException.class,org.springframework.web.HttpMediaTypeException.class,java.io.UnsupportedEncodingException.class,javax.servlet.ServletException.class})
@ResponseStatus(value=BAD_REQUEST)
@ResponseBody
public ErrorInfo methodArgumentNotValid(javax.servlet.http.HttpServletRequest req,
Exception ex)
@ExceptionHandler(value=org.springframework.web.bind.MethodArgumentNotValidException.class) @ResponseStatus(value=BAD_REQUEST) @ResponseBody public ErrorInfo methodArgumentNotValid(javax.servlet.http.HttpServletRequest req, org.springframework.web.bind.MethodArgumentNotValidException ex)