Throw an error to be caught by Error Boundaries
fuhton opened this issue · comments
Ideally, I'd be able to through an error on the System.import
that sends the content of that error to the Error Boundary component further up the tree.
resolve: () => System.import('./my/component.js').catch(e => throw e);
This is currently caught inside of the resolveModule
and is used for displaying the error component, instead of being thrown in the render()
cycle. Ideally, I'd be able to throw this error in the render function and utilize my parent Error Boundary to catch/display this error.
I'm not sure if this is an obvious use case, or covered by another configuration. I've thrown together a PR to show the use case either way.
For anyone else having an issue, it's easily solved with
const ErrorComponent = ({ error }) => { throw error.error; };