balena-cli/lib/errors.coffee
Juan Cruz Viotti ec77437080 Print plugin warnings in red as other errors
For the sake of consistency.
2015-10-06 18:51:17 -04:00

14 lines
309 B
CoffeeScript

chalk = require('chalk')
errors = require('resin-cli-errors')
patterns = require('./utils/patterns')
exports.handle = (error) ->
message = errors.interpret(error)
return if not message?
if process.env.DEBUG
message = error.stack
patterns.printErrorMessage(message)
process.exit(error.exitCode or 1)