fix: handle fatal errors

This commit is contained in:
Pooya Parsa 2018-04-02 00:06:30 +04:30
parent 46fcf47db1
commit 88c3cddf32

View File

@ -11,6 +11,16 @@ process.on('unhandledRejection', _error => {
logger.error(_error)
})
// Exit process on fatal errors
consola.add({
log(logObj) {
if (logObj.type === 'fatal') {
process.stderr.write('Nuxt Fatal Error :(\n')
process.exit(1)
}
}
})
if (!semver.satisfies(process.version, engines.node)) {
logger.fatal(
`The engine "node" is incompatible with ${name}. Expected version "${