Error handling in connectAdvanced can swallow errors
See original GitHub issueReported in Reactiflux chat by user “Bahamut”, who was not in a position to file a report himself.
Description:
There was a function being defined inside of a mapDispatch
function, like:
function mapDispatch(dispatch) {
return {
someFunction: () => dispatch({type : "SOME_ACTION", string : `some template literal`})
};
}
There was an error in the template literal, and that threw an error when the mapDispatch
function was checked by connectAdvanced()
at connectAdvanced.js#L15-25.
However, the error was swallowed by the try/catch
block there, and no visible error was reported in the console.
So, the important issue here appears to be that we have a try/catch
that swallows errors, and doesn’t report them in any way.
Would it be a good idea to use the warning()
util to log errors here?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:10
- Comments:15 (5 by maintainers)
Top Results From Across the Web
Handling operation errors - Apollo GraphQL Docs
Apollo Client helps you handle these errors according to their type, enabling you to show appropriate information to the user when an error...
Read more >Error hiding - Wikipedia
When errors are swallowed, these purposes can't be accomplished. Information about the error is lost, which makes it very hard to track down...
Read more >Error Boundaries - React
Error boundaries are React components that catch JavaScript errors anywhere in their child ... An error boundary can't catch an error within itself....
Read more >Why shouldn't I use catch() to handle errors in React useEffect ...
Note: it's important to handle errors here instead of a catch() block so that we don't swallow exceptions from actual bugs in components....
Read more >esxi host not responding but vms still running
I can still ping the host, and ping/rdp to the VMs that are running on it. ... already check the ESXi host's and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This needs to be fix. I spent a good amount of time trying to figure out why my debugger wasn’t getting hit in the mapState function. The error should show up in the console.
Realistically, I’m not going to have time to look at this any time soon. But I definitely won’t ever remember to look at it if there’s no new issue filed 😃