@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
VoltmxException
DataControllerRequest
, annotated with
VoltmxContext
DataControllerResponse
,
annotated with VoltmxContext
Map
, annotated
with VoltmxContext
Result
, annotated with VoltmxContext
For 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.