Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8e55adf

Browse files
timneutkensrauchg
authored andcommitted
Render error as errorHtml (vercel#3142)
1 parent 4d2ea0c commit 8e55adf

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

‎server/render.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,20 @@ async function doRender (req, res, pathname, query, {
7878
let html
7979
let head
8080
let errorHtml = ''
81+
8182
try {
82-
html = render(app)
83+
if (err && dev) {
84+
errorHtml = render(createElement(ErrorDebug, { error: err }))
85+
} else if (err) {
86+
errorHtml = render(app)
87+
} else {
88+
html = render(app)
89+
}
8390
} finally {
8491
head = Head.rewind() || defaultHead()
8592
}
8693
const chunks = loadChunks({ dev, dir, dist, availableChunks })
8794

88-
if (err && dev) {
89-
errorHtml = render(createElement(ErrorDebug, { error: err }))
90-
}
91-
9295
return { html, head, errorHtml, chunks }
9396
}
9497

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /