Commit 8e55adf4 authored by Tim Neutkens's avatar Tim Neutkens Committed by Guillermo Rauch

Render error as errorHtml (#3142)

parent 4d2ea0ce
...@@ -78,17 +78,20 @@ async function doRender (req, res, pathname, query, { ...@@ -78,17 +78,20 @@ async function doRender (req, res, pathname, query, {
let html let html
let head let head
let errorHtml = '' let errorHtml = ''
try { try {
html = render(app) if (err && dev) {
errorHtml = render(createElement(ErrorDebug, { error: err }))
} else if (err) {
errorHtml = render(app)
} else {
html = render(app)
}
} finally { } finally {
head = Head.rewind() || defaultHead() head = Head.rewind() || defaultHead()
} }
const chunks = loadChunks({ dev, dir, dist, availableChunks }) const chunks = loadChunks({ dev, dir, dist, availableChunks })
if (err && dev) {
errorHtml = render(createElement(ErrorDebug, { error: err }))
}
return { html, head, errorHtml, chunks } return { html, head, errorHtml, chunks }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment