-
Notifications
You must be signed in to change notification settings - Fork 184
Improper exception handling? #51
Comments
Hi, thanks for reporting! Server-side, there's no Promise.all([
context.executeAction(loadIntlMessages, { locale: req.locale }), // lets ignore this
context.executeAction(navigateAction, { url: req.url })
]).then(() => renderApp(req, res, context, next))
.catch(() => renderApp(req, res, context, next)); When executing
The trick here is that The What do you think? |
Well... If I guess this one is the only one that should not be missing.... |
Oh yes I see it now. The case of the HtmlHeadStore is weird. Not sure how to deal with it. Let me think :) |
So since the errors fired from route actions should always have a status code, we could write this: Promise.all([
context.executeAction(loadIntlMessages, { locale: req.locale }),
context.executeAction(navigateAction, { url: req.url })
]).then(() => renderApp(req, res, context, next))
.catch((err) => {
if (!err.statusCode || !err.status) {
next(err);
}
else {
renderApp(req, res, context, next);
}
}); |
It seems perfectly handled this way :) nice! |
🎉 |
I believe there is a problem in the current way exception are handled on the server rendering phase:
072f4c5#diff-0655f086119d60b6cf62f877f4128fa8R77
If the navigateAction fails somehow, you're still rendering the app in an inconsistant state.
Eg:
The text was updated successfully, but these errors were encountered: