This repository was archived by the owner on Jun 21, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
src/main/java/com/evanlennick/retry4j Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -192,17 +192,20 @@ private boolean shouldThrowException(Exception e) {
192
192
}
193
193
194
194
//config says to retry only on specific exceptions
195
- for (Class <? extends Exception > exceptionInSet : this .config .getRetryOnSpecificExceptions ()) {
196
- if (exceptionInSet .isAssignableFrom (e .getClass ())) {
195
+ for (Class <? extends Exception > exceptionToRetryOn : this .config .getRetryOnSpecificExceptions ()) {
196
+ if (exceptionToRetryOn .isAssignableFrom (e .getClass ())) {
197
197
return false ;
198
198
}
199
199
}
200
200
201
201
//config says to retry on all except specific exceptions
202
- for (Class <? extends Exception > exceptionInSet : this .config .getRetryOnAnyExceptionExcluding ()) {
203
- if (!exceptionInSet .isAssignableFrom (e .getClass ())) {
204
- return false ;
202
+ if (!this .config .getRetryOnAnyExceptionExcluding ().isEmpty ()) {
203
+ for (Class <? extends Exception > exceptionToNotRetryOn : this .config .getRetryOnAnyExceptionExcluding ()) {
204
+ if (exceptionToNotRetryOn .isAssignableFrom (e .getClass ())) {
205
+ return true ;
206
+ }
205
207
}
208
+ return false ;
206
209
}
207
210
208
211
return true ;
You can’t perform that action at this time.
0 commit comments