You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apps using node-fetch-try might want a different log message or use a different logging.
For example, they might want to log error details from a specific header or the response body. Currently it only prints the response.statusText in case of a non-success HTTP response.
Apps should be in control and be able to have node-fetch-retry not call console.* at all.
Proposal
Add the option for a custom function onRetry in the retryOptions that would be used instead of the current logging. Signature might follow the usual pattern
function onRetry(response, error) {
// response if response was returned otherwise null
// error if an error was thrown
}
Note sure how to handle the "on init" case, maybe another onInitLog function. Or use the npm debug library (which is off by default).
The text was updated successfully, but these errors were encountered:
Current Behaviour
Currently
node-fetch-retry
willconsole.log
orconsole.error
on retry (and other cases), with a specific message. For example here.Inventory of
console.*
:on retry:
on init (config read):
Issue
Apps using
node-fetch-try
might want a different log message or use a different logging.For example, they might want to log error details from a specific header or the response body. Currently it only prints the
response.statusText
in case of a non-success HTTP response.Apps should be in control and be able to have
node-fetch-retry
not callconsole.*
at all.Proposal
Add the option for a custom function
onRetry
in theretryOptions
that would be used instead of the current logging. Signature might follow the usual patternNote sure how to handle the "on init" case, maybe another
onInitLog
function. Or use the npmdebug
library (which is off by default).The text was updated successfully, but these errors were encountered: