mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-21 22:47:48 +00:00
904b9f07fb
- Move error translation logic to resin-io/resin-cli-errors. - Force `process.exit()`.
13 lines
268 B
CoffeeScript
13 lines
268 B
CoffeeScript
chalk = require('chalk')
|
|
errors = require('resin-cli-errors')
|
|
|
|
exports.handle = (error) ->
|
|
message = errors.interpret(error)
|
|
return if not message?
|
|
|
|
if process.env.DEBUG
|
|
message = error.stack
|
|
|
|
console.error(chalk.red(message))
|
|
process.exit(error.exitCode or 1)
|