@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
KonyException
DataControllerRequest
, annotated with
KonyContext
DataControllerResponse
,
annotated with KonyContext
Map
, annotated
with KonyContext
Result
, annotated with KonyContext
For example -
@OnException
public Result onError(@KonyContext Result result, @KonyContext DataControllerRequest request,
@KonyContext DataControllerResponse response, @KonyException Exception exception) {
// Do your custom error handling...
return result;
}
Copyright © 2019. All rights reserved.