@ControllerAdvice(basePackages="com.edorasware",
                  annotations=ApiController.class)
public class DefaultExceptionControllerAdvice
extends Object
The public API controller advice which catches the exceptions and returns the proper error messages to the front end.
| Constructor and Description | 
|---|
DefaultExceptionControllerAdvice(org.springframework.context.MessageSource messageSource)  | 
| Modifier and Type | Method and Description | 
|---|---|
ErrorResponse | 
handleIllegal(IllegalArgumentException e,
             Locale locale)  | 
ErrorResponse | 
handleNotFound(EntityNotFoundException e,
              Locale locale)  | 
ErrorResponse | 
handleOtherException(Exception e,
                    Locale locale)  | 
ErrorResponse | 
handleUnauthorized(org.springframework.security.access.AccessDeniedException e,
                  Locale locale)  | 
public DefaultExceptionControllerAdvice(org.springframework.context.MessageSource messageSource)
@ResponseStatus(value=BAD_REQUEST) @ExceptionHandler(value=java.lang.IllegalArgumentException.class) @ResponseBody public ErrorResponse handleIllegal(IllegalArgumentException e, Locale locale)
@ResponseStatus(value=UNAUTHORIZED) @ExceptionHandler(value=org.springframework.security.access.AccessDeniedException.class) @ResponseBody public ErrorResponse handleUnauthorized(org.springframework.security.access.AccessDeniedException e, Locale locale)
@ResponseStatus(value=NOT_FOUND) @ExceptionHandler(value=EntityNotFoundException.class) @ResponseBody public ErrorResponse handleNotFound(EntityNotFoundException e, Locale locale)
@ResponseStatus(value=INTERNAL_SERVER_ERROR) @ExceptionHandler(value=java.lang.Exception.class) @ResponseBody public ErrorResponse handleOtherException(Exception e, Locale locale)
Copyright © 2010 - 2018 edorasware ag. All Rights Reserved.