+ );
+ }
}
-export default class ErrorLogsPage {
+export default class ErrorReportingPage {
getElements() {
return [
-
Check the logs
,
- Nope,
- ]
+
Error Logging Tests
,
+
Render error
,
+ ,
+ ,
+ ,
+ ,
+ ,
+ ,
+ ,
+ ,
+ ,
+ ];
}
}
diff --git a/packages/react-server/core/ClientController.js b/packages/react-server/core/ClientController.js
index 9229a83d6..496ee8a67 100644
--- a/packages/react-server/core/ClientController.js
+++ b/packages/react-server/core/ClientController.js
@@ -675,12 +675,21 @@ class ClientController extends EventEmitter {
// Always render in order to proritize content higher in the
// page.
//
- elementPromises.reduce((chain, promise, index) => chain.then(
- () => promise.then(element => rootNodePromises[index]
- .then(root => renderElement(element, root, index))
- .catch(e => logger.error(`Error with element render ${index}`, e))
- ).catch(e => logger.error(`Error with element promise ${index}`, e))
- ), Q()).then(retval.resolve);
+ elementPromises.reduce((chain, promise, index) => chain
+ .then(() => promise
+ .then(element => rootNodePromises[index]
+ .then(root => renderElement(element, root, index))
+ .catch(e => {
+ // The only case where this should evaluate to false is
+ // when `element` is a containerClose/containerOpen object
+ const componentType = typeof element.type === 'function'
+ ? element.props.children.type.name
+ : 'element';
+ logger.error(`Error with element ${componentType}'s lifecycle methods at index ${index}`, e);
+ })
+ ).catch(e => logger.error(`Error with element promise ${index}`, e))
+ ),
+ Q()).then(retval.resolve);
// Look out for a failsafe timeout from the server on our
// first render.
diff --git a/packages/react-server/core/renderMiddleware.js b/packages/react-server/core/renderMiddleware.js
index 91a9e633f..348fc880d 100644
--- a/packages/react-server/core/renderMiddleware.js
+++ b/packages/react-server/core/renderMiddleware.js
@@ -804,7 +804,7 @@ function renderElement(res, element, context) {
// the `data-react-server-root-id` div for this component. We need
// to close it out and move on. This is a bummer, and we'll
// log it, but it's too late to totally bail out.
- logger.error(`Error rendering element ${name}`, err);
+ logger.error(`Error with element ${name}'s lifecycle methods`, err);
}
// We time how long _this_ element's render took, and also how long