Skip to content
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

Include previous error even if there's a timeout #70

Closed
cdeevfrr opened this issue Nov 4, 2019 · 0 comments · Fixed by #71
Closed

Include previous error even if there's a timeout #70

cdeevfrr opened this issue Nov 4, 2019 · 0 comments · Fixed by #71

Comments

@cdeevfrr
Copy link
Contributor

cdeevfrr commented Nov 4, 2019

Why (this section hopefully won't change)

We are using the async-retry library, which seems to make a new retryOperation object, call attempt on it, and then call retry on it if needed. If it passes in an error to retry, it seems to rely on node-retry to add the error to the list of errors that's being kept.

However, when there is a timeout, the error passed in is dropped. In practice, this means that when something throws one error and then times out, the one error is never added to retryOperation._errors, so our code (which eventually receives operation.mainError()) gets the error message "RetryOperation timeout occurred".

What (this section hopefully won't change)

It would be nice if the error passed in to retry always made its way into the _errors array, so this wouldn't happen.

How (open to change)

We can copy line 53 and paste just above line 49. I would have made a PR but I couldn't figure out how to do it on this repo.

OlliV pushed a commit to turist-cloud/async-retry-ng that referenced this issue Dec 15, 2019
tim-kos/node-retry#70

Signed-off-by: Olli Vanhoja <olli.vanhoja@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant