fix: show server errors in console

This commit is contained in:
Pooya Parsa 2017-09-12 02:57:51 +04:30
parent 19a943d44c
commit e289edc67e

View File

@ -352,6 +352,11 @@ export default class Renderer extends Tapable {
err.message = err.message || 'Nuxt Server Error'
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') => {
// Set Headers
res.statusCode = err.statusCode