balena-cli/build/errors.js
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

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);