mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-27 17:18:51 +00:00
15 lines
345 B
CoffeeScript
15 lines
345 B
CoffeeScript
TypedError = require('typed-error')
|
|
log = require('../log/log')
|
|
|
|
exports.NotFound = class NotFound extends TypedError
|
|
contructor: (name) ->
|
|
@message = "Couldn't find #{name}"
|
|
|
|
exports.handle = (error, exit = true) ->
|
|
return if not error? or error not instanceof Error
|
|
|
|
if error.message?
|
|
log.error(error.message)
|
|
|
|
process.exit(1) if exit
|