Error Handling
See original GitHub issuePlease forgive me if we’ve already had a discussion on this topic, and I know this is subject to change with the API proposals brewing, but I wanted to capture the state of affairs as of this moment.
Because of the indirection with events.action
and events.resolve
it’s not possible to catch any errors that are thrown within the execution of an action today. I believe the same will also hold true for the coming hooks
API.
It is possible to catch and handle view errors with an HOC.
React 16 is introducing Error Boundaries to handle this problem. I’m not proposing we add anything to core, but wondering what the best practice should be.
Here’s a small demo pen showing view/sync action/async action errors and how one might handle them with an HOA: https://codepen.io/okwolf/pen/rGWpgJ?editors=0010
Issue Analytics
- State:
- Created 6 years ago
- Reactions:6
- Comments:29 (26 by maintainers)
Guys,
is a joke. A bad one. 🙇
h('h1', { onerror: () => console.log("Can't you recognize sarcasm when you see it!?") }, 'What could possible go wrong?')