mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-13 09:33:54 +00:00
fix: show server errors in console
This commit is contained in:
parent
19a943d44c
commit
e289edc67e
@ -352,6 +352,11 @@ export default class Renderer extends Tapable {
|
|||||||
err.message = err.message || 'Nuxt Server Error'
|
err.message = err.message || 'Nuxt Server Error'
|
||||||
err.name = (!err.name || err.name === 'Error') ? 'NuxtServerError' : err.name
|
err.name = (!err.name || err.name === 'Error') ? 'NuxtServerError' : err.name
|
||||||
|
|
||||||
|
// We hide actual errors from end users, so show them on server logs
|
||||||
|
if (err.statusCode !== 404) {
|
||||||
|
console.error(err) // eslint-disable-line no-console
|
||||||
|
}
|
||||||
|
|
||||||
const sendResponse = (content, type = 'text/html') => {
|
const sendResponse = (content, type = 'text/html') => {
|
||||||
// Set Headers
|
// Set Headers
|
||||||
res.statusCode = err.statusCode
|
res.statusCode = err.statusCode
|
||||||
|
Loading…
Reference in New Issue
Block a user