sindresorhus / ky

🌳 Tiny & elegant JavaScript HTTP client based on the Fetch API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

is there a way to prevent HttpError when response is not in range

michelecocuccio opened this issue · comments

Hello, I am working with an external company that is still working on their api and at the moment it return some out of range status code, and I get the ERROR RangeError: Failed to construct 'Response': The status provided (0) is outside the range [200, 599].

Is there a way to disable / prevent this error? I tried with throwHttpErrors set to false but it does nothing. The thing is that in this way I can't test the entire flow of the app as I always get this error first and can't intercept any failed request etc...

Screenshot 2023-09-26 at 16 38 15

The error is coming from your Fetch polyfill, not from Ky.

The error is coming from your Fetch polyfill, not from Ky.

Sorry. My bad!