Mykola Palamarchuk
06/21/2022, 2:32 PMRetryRequested
? And how does it work internally?
My case: a HTTP request may fail sometimes with different errors that require individual retry policy. E.g. some response means we have to wait 30 seconds and can be retry only once (NotReadyYetException), but another response requires exponential timeout and can be retried more times (TemporaryServerOutageException). Is it possible to model that somehow?David Hyman
06/21/2022, 2:44 PMRetryRequested
with the different parameters you described
try:
request
except NotYetReady as e:
raise RetryRequested(seconds_to_wait=30) from e
except TemporaryOutage as e:
raise RetryRequested(backoff=Backoff.EXPONENTIAL) from e
Mykola Palamarchuk
06/21/2022, 3:05 PMDavid Hyman
06/21/2022, 3:20 PM