Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[api] Update jitsu.showError() to display appropriate drone stack tra…

…ces returned from nodejitsu / haibu >=0.3.6
  • Loading branch information...
commit fa5c037dd804a6e18fc9ef9af459075de0bb2225 1 parent 8754c11
Charlie Robbins indexzero authored
Showing with 17 additions and 7 deletions.
  1. +17 −7 lib/jitsu.js
24 lib/jitsu.js
View
@@ -278,13 +278,23 @@ jitsu.showError = function (command, err, shallow, skip) {
winston.error(err.result.error);
}
- if (err.result.result && err.result.result.error && err.result.result.error.stack) {
- winston.warn('Error returned from Haibu');
- winston.error('Message: ' + err.result.result.error.message);
- winston.error('');
- err.result.result.error.stack.split('\n').forEach(function (line) {
- winston.error(line);
- })
+ if (err.result.result && err.result.result.error) {
+ if (err.result.result.error.stderr) {
+ winston.warn('Error returned from drone');
+ winston.error('');
+ err.result.result.error.stderr.split('\n').forEach(function (line) {
+ winston.error(line);
+ })
+ }
+
+ if (err.result.result.error.stack && jitsu.config.get('debug')) {
+ winston.warn('Error returned from Haibu');
+ winston.error('Message: ' + err.result.result.error.message);
+ winston.error('');
+ err.result.result.error.stack.split('\n').forEach(function (line) {
+ winston.error(line);
+ });
+ }
}
else if (err.result.stack) {
winston.warn('Error returned from Nodejitsu');
Please sign in to comment.
Something went wrong with that request. Please try again.