Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
84d00ad1
Commit
84d00ad1
authored
Apr 25, 2017
by
Arunoda Susiripala
Committed by
GitHub
Apr 25, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Always send an error to client if there is. (#1800)
In the production, we need to send a dummy error.
parent
da775f2e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
render.js
server/render.js
+9
-1
No files found.
server/render.js
View file @
84d00ad1
...
@@ -97,7 +97,7 @@ async function doRender (req, res, pathname, query, {
...
@@ -97,7 +97,7 @@ async function doRender (req, res, pathname, query, {
buildId
,
buildId
,
buildStats
,
buildStats
,
assetPrefix
,
assetPrefix
,
err
:
(
err
&&
dev
)
?
errorToJSON
(
err
)
:
null
err
:
(
err
)
?
serializeError
(
dev
,
err
)
:
null
},
},
dev
,
dev
,
staticMarkup
,
staticMarkup
,
...
@@ -191,6 +191,14 @@ function errorToJSON (err) {
...
@@ -191,6 +191,14 @@ function errorToJSON (err) {
return
json
return
json
}
}
function
serializeError
(
dev
,
err
)
{
if
(
dev
)
{
return
errorToJSON
(
err
)
}
return
{
message
:
'500 - Internal Server Error.'
}
}
export
function
serveStatic
(
req
,
res
,
path
)
{
export
function
serveStatic
(
req
,
res
,
path
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
send
(
req
,
path
)
send
(
req
,
path
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment