Package org.chenile.core.interceptors
Class ChenileExceptionHandler
java.lang.Object
org.chenile.core.interceptors.BaseChenileInterceptor
org.chenile.core.interceptors.ChenileExceptionHandler
- All Implemented Interfaces:
Command<ChenileExchange>
Handles all exceptions by:
Translating all errors and warnings to international language. (service is assumed to throw just error code and not error message)
This can be extended to provide custom functionality.
But be sure that the extended exception handler is instantiated in a spring configuration and the
name of the spring configuration must be set in chenile.exception.handler in "chenile.properties"
- Author:
- Raja Shankar Kolluru
-
Field Summary
Modifier and TypeFieldDescription(package private) org.slf4j.Logger
(package private) MessageSource
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
doPostProcessing
(ChenileExchange exchange) Override this to do post processing.private String
protected void
translateErrors
(ChenileExchange exchange) private void
translateResponseMessages
(ChenileExchange exchange) protected void
translateWarnings
(ChenileExchange exchange) Methods inherited from class org.chenile.core.interceptors.BaseChenileInterceptor
bypassInterception, doContinue, doPreProcessing, execute, getExtensionByAnnotation, getExtensionByAnnotation, resumeFromSavedPoint, savePoint
-
Field Details
-
logger
org.slf4j.Logger logger -
messageSource
-
-
Constructor Details
-
ChenileExceptionHandler
public ChenileExceptionHandler()
-
-
Method Details
-
doPostProcessing
Description copied from class:BaseChenileInterceptor
Override this to do post processing. This will be called even if there is an exception downstream. So make sure that if you don't want to do any processing in case of exception, check ifChenileExchange.getException()
returns null value. If you happen to throw an exception in this method, it will get added to the set of errors that would ultimately be returned. See alsoChenileExchange.setException(Throwable)
- Overrides:
doPostProcessing
in classBaseChenileInterceptor
- Parameters:
exchange
- Chenile Exchange
-
translateResponseMessages
-
translateErrors
-
translateWarnings
-
translate
-