aboutsummaryrefslogtreecommitdiff
path: root/vnext/server/middleware/renderer.js
diff options
context:
space:
mode:
Diffstat (limited to 'vnext/server/middleware/renderer.js')
-rw-r--r--vnext/server/middleware/renderer.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/vnext/server/middleware/renderer.js b/vnext/server/middleware/renderer.js
index ca2ac2df..646e7d6c 100644
--- a/vnext/server/middleware/renderer.js
+++ b/vnext/server/middleware/renderer.js
@@ -63,8 +63,19 @@ const serverRenderer = async (req, res) => {
res.write(propsData);
pipe(res, { end: false });
},
+ onShellError() {
+ didError = true;
+ res.statusCode = 500;
+ res.setHeader('Content-type', 'text/html');
+ res.send(
+ '<h1>Something went wrong :(</h1>'
+ );
+ res.end();
+ },
onAllReady() {
- res.write(data[1]);
+ if (!didError) {
+ res.write(data[1]);
+ }
res.end();
},
onError(err) {