Closed mmadson closed 3 years ago
Throwing a RetryAttemptsExhausted
error would require callers to add handling for that, it seems you could (if extra handling is needed anyway) handle the underlying error or errorful result. E.g. if you retry on a DatabaseNotAvailable
error, handle that if it bubbles up from the retry.
I'd like to know when the configured retry attempts have been exhausted. Currently the only way for me to do this is by registering on onGiveUp event emitter but this has the drawback of having to dispose of the listener. Would much prefer I could configure the retry policy to throw for me rather than exhausting the attempts and silently returning the last result.