This commit is contained in:
Sebastien Chopin 2017-05-05 16:47:28 +02:00
parent 01b02a9010
commit 39db08c95b
2 changed files with 11 additions and 10 deletions

View File

@ -136,13 +136,14 @@ export default function () {
debug(`HTML Files generated in ${duration}s`)
if (errors.length) {
console.error('==== Error report ==== \n' + errors.map( ({type, route, error}) => {
const report = errors.map(({ type, route, error }) => {
if (type === 'unhandled') {
return `Route: '${route}'\n${error.stack}`
} else {
return `Route: '${route}' thrown an error: \n` + JSON.stringify(error)
}
}).join('\n\n'))
})
console.error('==== Error report ==== \n' + report).join('\n\n') // eslint-disable-line no-console
}
return this
})