@@ -46,7 +46,7 @@ public static boolean areRetryParamsOverridden() {
46
46
return OVERRIDE_ATTEMPT_COUNT != null || OVERRIDE_DELAY_BETWEEN_ATTEMPTS != null ;
47
47
}
48
48
49
- public static <V , E extends Exception > V executeOnRest (String errorMessage , GenericCallable <V , E > callable ) throws E {
49
+ public static <V , E extends Exception > V executeOnRest (String errorMessage , GenericCallable <V , E > callable ) throws E , UnrecoverableRecordException {
50
50
return execute (errorMessage , DEFAULT_REST_ATTEMPTS , DELAY_BETWEEN_REST_ATTEMPTS , callable );
51
51
}
52
52
@@ -55,7 +55,7 @@ public static <V, E extends Exception> V executeOnRest(String errorMessage, Gene
55
55
// of type E or RuntimeException, cause of callable type. Both are expected to be thrown by this method.
56
56
public static <V , E extends Throwable > V execute (String errorMessage , int maxAttempts ,
57
57
int sleepTimeBetweenRetriesMs ,
58
- GenericCallable <V , E > callable ) throws E {
58
+ GenericCallable <V , E > callable ) throws E , UnrecoverableRecordException {
59
59
maxAttempts = Optional .ofNullable (OVERRIDE_ATTEMPT_COUNT ).orElse (maxAttempts );
60
60
sleepTimeBetweenRetriesMs = Optional .ofNullable (OVERRIDE_DELAY_BETWEEN_ATTEMPTS ).orElse (sleepTimeBetweenRetriesMs );
61
61
while (true ) {
@@ -66,6 +66,8 @@ public static <V, E extends Throwable> V execute(String errorMessage, int maxAtt
66
66
throw new RetryInterruptedException (e );
67
67
} catch (UnrecoverableJobException e ) {
68
68
throw new SuppressRestartsException (e );
69
+ } catch (UnrecoverableRecordException e ) {
70
+ throw e ;
69
71
} catch (Exception e ) {
70
72
if (--maxAttempts > 0 ) {
71
73
LOGGER .warn ("{} - {} Retries Left {} " , errorMessage , e .getMessage (), maxAttempts , e );
0 commit comments