mirror of
https://github.com/pnpm/pnpm.git
synced 2026-02-05 12:41:44 -05:00
Promises and Object.assign are available in Node >= 4, so there is no need to have the bluebird and object-assign dependencies.
17 lines
468 B
JavaScript
17 lines
468 B
JavaScript
var chalk = require('chalk')
|
|
|
|
module.exports = function err (error) {
|
|
console.error('')
|
|
if (error.host && error.path) {
|
|
console.error('' + error.message)
|
|
console.error('' + error.method + ' ' + error.host + error.path)
|
|
} else {
|
|
console.error(chalk.red(' ! ' + (error.message || error)))
|
|
if (process.env.DEBUG_PROMISE && error.stack && !error.silent) {
|
|
console.error(chalk.red(error.stack))
|
|
}
|
|
}
|
|
console.error('')
|
|
process.exit(1)
|
|
}
|