Skip to content

Commit

Permalink
Merge pull request #479 from nodejitsu/error-handling
Browse files Browse the repository at this point in the history
[fix] Improve error output
  • Loading branch information
julianduque committed Dec 2, 2013
2 parents 20e7dbc + 17109d0 commit 0f9f720
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/jitsu.js
Expand Up @@ -365,6 +365,19 @@ jitsu.showError = function (command, err, shallow, skip) {
jitsu.log.error(err.result.message);
}

if (err.result.error) {
if (~err.result.error.indexOf('matching versions')) {
jitsu.log.error(err.result.error);
jitsu.log.error("Do not use a specific engine version, try a generic one (eg: 0.8.x or 0.10.x)");
}
else if (~err.result.error.indexOf('npm exited')) {
jitsu.log.error(err.result.error);
jitsu.log.error("npm installation failed, please double check your package.json dependencies");
} else {
jitsu.log.error(err.result.error);
}
}

if (err.result.errors && Array.isArray(err.result.errors)) {
errors = {
connection: err.result.errors.filter(function (err) {
Expand Down

0 comments on commit 0f9f720

Please sign in to comment.