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

Use DOMException to throw errors #7

Open
acostalima opened this issue Jan 18, 2021 · 1 comment
Open

Use DOMException to throw errors #7

acostalima opened this issue Jan 18, 2021 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@acostalima
Copy link
Collaborator

acostalima commented Jan 18, 2021

I believe React Native's environment does not provide DOMException, so we need to use a polyfill or develop our own. Check domexpection. If that's the case, for consistency's sake, the polyfill should be delivered via react-native-polyfill-globals.
Check GitHub's implementation for inspiration.

DOMException should be thrown when:

  • fetch is aborted

See: https://developers.google.com/web/updates/2017/09/abortable-fetch

@acostalima acostalima changed the title Use DOMException to throw appropriate errors Use DOMException to throw errors Jan 18, 2021
@acostalima acostalima added help wanted Extra attention is needed enhancement New feature or request labels Jan 18, 2021
@tom-sherman
Copy link

Related: node-fetch/node-fetch#1519

Note: This is technically part of the AbortController spec. React Native currently uses https://github.com/mysticatea/abort-controller so the change will need to be made there I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants