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

Refactor DOMException handling code to avoid redundant exceptions generation #724

Closed
RedMickey opened this issue Oct 11, 2019 · 5 comments · Fixed by #797
Closed

Refactor DOMException handling code to avoid redundant exceptions generation #724

RedMickey opened this issue Oct 11, 2019 · 5 comments · Fixed by #797

Comments

@RedMickey
Copy link

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.

@canpoyrazoglu
Copy link

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.

@andrekovac
Copy link

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

@canpoyrazoglu
Copy link

canpoyrazoglu commented May 5, 2020

@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.

@JakeChampion
Copy link
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.

@JakeChampion
Copy link
Owner

That took 3 minutes to fix. #797

JakeChampion added a commit that referenced this issue Jul 9, 2020
… and catching the exception which may get thrown

fixes #724
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 6, 2021
cr313 added a commit to cr313/fetch-Js-flow that referenced this issue Apr 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants