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

Error not set correctly #52

Open
mokargas opened this issue Jul 7, 2021 · 2 comments
Open

Error not set correctly #52

mokargas opened this issue Jul 7, 2021 · 2 comments

Comments

@mokargas
Copy link

mokargas commented Jul 7, 2021

Hey all, perhaps I'm not understanding something here

Using to
const [err, data] = await to(fetch('http://httpstat.us/500')); console.debug(err, data)

Result:
image

Shouldn't a 500 with a response.ok = false give something in err?

@zraineri
Copy link

The promise didn't fail

The promise happened successfully without erroring. Here you'd want to add your own custom additional error checks for when the status code is not 200

@Pierre-Mike
Copy link

Should the issue be closed?

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

3 participants