-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New feature: retry decorator for specific exceptions #237
Comments
Not so sure about this, IMO this is much better solved by python:
With a decorator this level of flexibility is hard to achieve and ends up polluting the core (which I think it should be as simple and lean as possible to minimize the chances of bugs). Also, note that a |
This is similar to the discussion we had (offline, sorry about that) here: #3 |
@dbarrosop currently library exception is not raised, only |
We could easily reraise the original exception in the subtask case. Either that or just something like:
|
Could you give the whole example with let's say some Netmiko exception or Napalm? |
Task queues like celery, have a built-in decorator to handle retry for specific exceptions:
http://docs.celeryproject.org/en/latest/userguide/tasks.html#retrying
I think we could implement something similar, where you could specify a list of exceptions for the task for which you want to retry and how many times you want to retry.
The text was updated successfully, but these errors were encountered: