mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-21 22:47:48 +00:00
ec77437080
For the sake of consistency.
24 lines
471 B
JavaScript
24 lines
471 B
JavaScript
(function() {
|
|
var chalk, errors, patterns;
|
|
|
|
chalk = require('chalk');
|
|
|
|
errors = require('resin-cli-errors');
|
|
|
|
patterns = require('./utils/patterns');
|
|
|
|
exports.handle = function(error) {
|
|
var message;
|
|
message = errors.interpret(error);
|
|
if (message == null) {
|
|
return;
|
|
}
|
|
if (process.env.DEBUG) {
|
|
message = error.stack;
|
|
}
|
|
patterns.printErrorMessage(message);
|
|
return process.exit(error.exitCode || 1);
|
|
};
|
|
|
|
}).call(this);
|