mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-25 08:21:04 +00:00
ec77437080
For the sake of consistency.
14 lines
309 B
CoffeeScript
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)
|