use of org.sklsft.commons.api.exception.ApplicationException in project skeleton-commons by skeleton-software-community.
the class AjaxMethodAspect method execute.
@Around("ajaxMethods()")
public void execute(ProceedingJoinPoint joinPoint) throws Throwable {
Method proxiedMethod = ((MethodSignature) joinPoint.getSignature()).getMethod();
AjaxMethod ajaxMethod = proxiedMethod.getAnnotation(AjaxMethod.class);
String value = ajaxMethod.value();
try {
logger.info(value);
joinPoint.proceed();
messageHandler.displayInfo(value + ".success");
logger.info("completed");
} catch (ApplicationException e) {
messageHandler.displayError(e.getMessage());
logger.error("failed : " + e.getClass().getSimpleName() + " - " + e.getMessage(), e);
} catch (Exception e) {
messageHandler.displayError(value + ".failure");
logger.error("failed : " + e.getClass().getSimpleName() + " - " + e.getMessage(), e);
}
}
Aggregations