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

Remove assertNever assertion for Axios requests #2977

Closed
wants to merge 1 commit into from

Conversation

joeyballentine
Copy link
Member

There appears to be an error type that axios does not have a type for: Network errors. Because of this, the error value is not really never and therefore we cannot assertNever there.

This does not fix the initial issue though, as the error will still throw.

Should it throw? I'm not really sure what even causes the network error (i did get it myself once when working on a different PR), but it seems to have to do with the backend restarting from code changes, which regular users will not have to deal with.

@RunDevelopment
Copy link
Member

I looked into this a little and the problem is that the type guard for isCancel is wrong: axios/axios#5153. There is a PR for a fix (axios/axios#5595), but the maintainer of the package seems to not be very active.

So I think the real fix is to not use the bugged isCancel for the time being and instead check for instanceof axios.CanceledError directly.

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

Successfully merging this pull request may close these issues.

2 participants