@Target(value=METHOD) @Retention(value=RUNTIME) public @interface OnException
Use this annotation to mark a method as exception handler in
DataPostProcessor and DataPostProcessor2 classes. If
DataPreProcessor or DataPreProcessor2 or the actual back-end
service call throws an exception, then the DataPostProcessor.execute
and DataPostProcessor2.execute methods are not called, instead method
annotated with the below type is called.
The exception handler method could have any of below optional parameters in any order -
Exception, annotated with
VoltmxExceptionDataControllerRequest, annotated with
VoltmxContextDataControllerResponse,
annotated with VoltmxContextMap, annotated
with VoltmxContextResult, annotated with VoltmxContextFor example -
@OnException
public Result onError(@VoltmxContext Result result, @VoltmxContext DataControllerRequest request,
@VoltmxContext DataControllerResponse response, @VoltmxException Exception exception) {
// Do your custom error handling...
return result;
}
Copyright © 2019. All rights reserved.