public interface ExceptionHandler
CompletionPolicy
will be used to decide whether to end a batch when
there is no exception, and the ExceptionHandler
is used to signal an
abnormal ending - an abnormal ending would result in an
ExceptionHandler
throwing an exception. The caller will catch and
re-throw it if necessary.Modifier and Type | Method and Description |
---|---|
void |
handleException(RepeatContext context,
Throwable throwable)
Deal with a Throwable during a batch - decide whether it should be
re-thrown in the first place.
|
void handleException(RepeatContext context, Throwable throwable) throws Throwable
context
- the current RepeatContext
. Can be used to store
state (via attributes), for example to count the number of occurrences of
a particular exception type and implement a threshold policy.throwable
- an exception.Throwable
- implementations are free to re-throw the exceptionCopyright © 2014 Pivotal. All rights reserved.