jd / tenacity

Retrying library for Python
http://tenacity.readthedocs.io
Apache License 2.0
6.54k stars 280 forks source link

Access all occurred exceptions in `RetryError` #477

Open mtvx opened 2 months ago

mtvx commented 2 months ago

It would be useful to have access to the exceptions/stacktraces of all attempts, via RetryError.

This would allow to create e.g. metrics out of failed attempts and in general have some logic based on all failures (not only the last).

blr246 commented 2 months ago

I have a way to do this that I was just thinking would be good to contribute upstream. It uses the existing API so it's really just like a wrapper / extension. I'm still looking for the contribution guidelines for this project. I'll check in again during the workweek with more info.