Skip to content

Refactor DOMException handling code to avoid redundant exceptions generation #724

Closed

Description

@RedMickey

Hello, we are the development team of VS Code extension for debugging React Native apps (vscode-react-native). whatwg-fetch package is used in React Native lib. In our extension we debug React Native apps as a Node.js processes. Node JS global context doesn't contain DOM modules, so "exports.DOMException is not a constructor" exception is generated in whatwg-fetch package if fetch function is used in a React Native project.
Could it be better to firstly verify if there is DOMException module in environment global context and only after that use try/catch construction? If DOMException module doesn’t exist it can be better to create this module without exception generation.
Here is the issue for the corresponding case in the debugger extension repository.

Activity

  1. canpoyrazoglu commented on Nov 21, 2019

    @canpoyrazoglu

    This really becomes counterproductive when All Exceptions checkbox is enabled as this is hit everytime the app is restarted. I'd like to leave All Exceptions on, but can't because of this being hit each time, causing me to lose my focus, hit continue, go back to the file that I was working on etc.

  2. andrekovac commented on May 5, 2020

    @andrekovac

    Would be great if this issue could be taken into consideration!

  3. canpoyrazoglu commented on May 5, 2020

    @canpoyrazoglu

    @andrekovac exactly. I've got so many dependencies, none of them causing anything like this. It's only fetch, and causing whole (already-slow) debugger to step everytime I restart my RN app, and no one is even willing to fix it. I think I'll just switch to something else like axios if none of my dependencies explicitly depend on fetch.

  4. JakeChampion commented on Jul 9, 2020

    @JakeChampion
    Owner

    and no one is even willing to fix it.

    @canpoyrazoglu, you yourself are not willing to fix this. This is an open source project worked on by people in their spare time. You can just as easily fix the issue yourself.

  5. JakeChampion commented on Jul 9, 2020

    @JakeChampion
    Owner

    That took 3 minutes to fix. #797

  6. locked as resolved and limited conversation to collaborators on Jan 6, 2021
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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions