git ssb

1+

dinoworm ๐Ÿ› / catstack



Commit 51f5f8f504793351faa020ae6f5b8826c175aceb

handle renderToString errors

Michael Williams committed on 12/31/2015, 5:29:33 AM
Parent: dbd9f9c0dbba6cc0b96fbf4b1c329a25b5fec854

Files changed

app/stack/render.jschanged
app/stack/render.jsView
@@ -36,9 +36,15 @@
3636 const component = <Provider store={store} key="provider">
3737 <RoutingContext { ...renderProps } />
3838 </Provider>
3939
40- const innerHtml = renderToString(component)
40+ var innerHtml
41+ try {
42+ innerHtml = renderToString(component)
43+ } catch (err) {
44+ res.setHeader('content-type', 'text/plain')
45+ res.status(500).send(err.stack)
46+ }
4147
4248 const html = renderFullPage(innerHtml, store.getState())
4349
4450 res.send(html)

Built with git-ssb-web