pycontribs/jira

Allow defining conditions for `__recoverable`

rynkk opened this issue · 0 comments

Problem trying to solve

ResilientSession -> "This class is supposed to retry requests that do return temporary errors"

But, users can currently not define custom "temporary errors". E.g., I am currently often getting my scripts interrupted by "jira.exceptions.JIRAError: JiraError HTTP 502 (Bad Gateway)" caused by unstable servers. I'm sure there are cases where this is not retryable, but in my case it is (the very next request would work fine).

Possible solution(s)

Expose __recoverable in the sense that conditions can be user-defined and passed into the initialization of a JIRA object. The conditions would then be used somewhere in the __recoverable method.

Alternatives

No response

Additional Context

I plan on creating a PR for this in the near-to-far future, if people think this is a sensible approach.

Jannik Meinecke jannik.meinecke@mercedes-benz.com on behalf of MBition GmbH.

[Provider Information|https://github.com/mercedes-benz/foss/blob/master/PROVIDER_INFORMATION.md]