Closed sidoruk-sv closed 4 years ago
Actually, we do emit an event, BM catches this event and reports to Sentry, but we would like to add onSuccess/onLoad
and onError
props (instead since the events are unfocused).
https://github.com/wix/react-module-container/blob/master/src/base-lazy-component.js#L27
Actually, we do emit an event, BM catches this event and reports to Sentry
How do you catch that?
cause our listener for reactModuleContainer.error
didn't helped, and we spent some time to understand that problem was thrown from resolve
method
Am I right that due to that fact that resolved was called before Promise.all
any errors from it didn't get to Promise.all().catch
and there is a need to add additional try catch
around line 22
Hmmm.. seems like I'm not correct, so will digg for another reason why our listener for reactModuleContainer.error
was not triggered and we could not identify the problem.
Found my problem: we add reactModuleContainer.error
listener after the error occurred(
So we have no chances to get any notifications from that)
It is true though btw that if resolve
throws synchronously then the error won't be caught but in that case I believe a React ErrorBoundary can help.
For now nothing rendered and there is no errors for such case:
related code: https://github.com/wix/react-module-container/blob/master/src/base-lazy-component.js#L22 Mention that calling of
resolve()
is not wrapped with try catch, socomponentWillMount
fails in silence.