Package com.aquima.web.api.controller.v2
Class ApiExceptionHandler
java.lang.Object
com.aquima.web.api.controller.v2.ApiExceptionHandler
@Component("v2ApiExceptionHandler")
@ControllerAdvice(basePackageClasses=AbstractBaseController.class)
@Order(2147483647)
@ServerContext
public class ApiExceptionHandler
extends Object
Class defines exception handlers for generic exceptions.
These exception can be overwriting when needed by defining a new
ControllerAdvice
with a bigger precedence
Note: It should not contain specific exceptions !- Since:
- 11.2
- Author:
- Mihai Bob
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionhandleGenericException
(Exception exception) handleIllegalStateException
(IllegalStateException exception) handlePortalException
(Exception exception)
-
Field Details
-
ERROR_OCCURRED_MESSAGE
- See Also:
-
-
Constructor Details
-
ApiExceptionHandler
public ApiExceptionHandler()
-
-
Method Details
-
handleIllegalStateException
@ExceptionHandler(java.lang.IllegalStateException.class) @ResponseStatus(INTERNAL_SERVER_ERROR) @ResponseBody public JsonError handleIllegalStateException(IllegalStateException exception) -
handlePortalException
-
handleGenericException
@ExceptionHandler(java.lang.Exception.class) @ResponseStatus(INTERNAL_SERVER_ERROR) @ResponseBody public JsonError handleGenericException(Exception exception)
-