Most likely
|
if (retryableExceptions.contains(e) || e.getCause() instanceof EOFException) |
should be
if (retryableExceptions.contains(e.getClass()) || e.getCause() instanceof EOFException)
, because retryableExceptions is a set of Classes not a set of exceptions. But actually retryableExceptions.contains(e) can be removed all together, because it is implicit covered by line 44
A more general suggestion of my would be to make recoverable exceptions more configurable. Let users provide predicates if exceptions are recoverable or not, because more often than not you have a whole exception cause chain. And only checking type of the outermost exception does not suffice.
Most likely
lyra/src/main/java/net/jodah/lyra/internal/util/Exceptions.java
Line 46 in ce347a6
should be
if (retryableExceptions.contains(e.getClass()) || e.getCause() instanceof EOFException), because retryableExceptions is a set of Classes not a set of exceptions. But actually retryableExceptions.contains(e) can be removed all together, because it is implicit covered by line 44
A more general suggestion of my would be to make recoverable exceptions more configurable. Let users provide predicates if exceptions are recoverable or not, because more often than not you have a whole exception cause chain. And only checking type of the outermost exception does not suffice.