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

node-fetch causes silent failure #358

Open
braxtonhall opened this issue Oct 23, 2020 · 0 comments
Open

node-fetch causes silent failure #358

braxtonhall opened this issue Oct 23, 2020 · 0 comments

Comments

@braxtonhall
Copy link
Contributor

When using

try {
    const response = await rp(rpOptions);
} catch (err) {
   ...
}

A 4XX response would throw an error, causing it to go into the catch

However

try {
    const response = await fetch(uri, options);
} catch (err) {
   ...
}

A 4XX will not throw an error, instead you need to check the response's status code.

It seems like there are a few places that rely on the thrown error to trace failure.

@braxtonhall braxtonhall mentioned this issue Sep 26, 2022
23 tasks
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

No branches or pull requests

1 participant