Skip to content

Use DOMException to throw errors #7

Open

Description

@acostalima

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

Activity

  1. changed the title [-]Use DOMException to throw appropriate errors[/-] [+]Use DOMException to throw errors[/+] on Jan 18, 2021
  2. tom-sherman commented on May 31, 2022

    @tom-sherman

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions