-
Notifications
You must be signed in to change notification settings - Fork 21
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
handle developer errors from callbacks separate from fetch errors #87
Comments
+1 |
note: we pass in Lines 48 to 51 in 3e512e5
However, I agree we should separate these two functions so its more readable |
@jdelbick but |
@alexkli so you mean the situation if
edit, splitting out the try/catches & adding error handling, I get it
|
Currently we share the same catch clause for
fetch()
and for theshouldRetry()
here:node-fetch-retry/index.js
Lines 217 to 227 in 3e512e5
shouldRetry includes calling the callbacks
retryOnHttpError()
andretryOnHttpResponse()
. These callbacks could have developer errors on which we should not retry blindly.Instead, we should separate the error handling, and for errors on the callbacks pass them through as clear errors (and do not retry) so the developers can fix their code.
The text was updated successfully, but these errors were encountered: