Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #392 from nodejitsu/timeout-errs

[fix] fix for differentiating socket hang up vs local timeouts
  • Loading branch information...
commit da85b7d0e4e43461d941b5635f4487263e159332 2 parents aa6fc40 + b3b3a1a
Charlie McConnell AvianFlu authored
Showing with 9 additions and 20 deletions.
  1. +9 −20 lib/jitsu.js
29 lib/jitsu.js
View
@@ -363,26 +363,15 @@ jitsu.showError = function (command, err, shallow, skip) {
}
else {
if (err.stack && !shallow) {
- if (err.message && err.message === 'socket hang up') {
- if (err.code) {
- jitsu.log.info('');
- if (err.code === 'ECONNRESET') {
- jitsu.log.info(
- 'jitsu\'s client request timed out before the server ' +
- 'could respond. Please increase your client timeout' +
- '(Ex. `jitsu config set timeout 100000`)'
- );
- jitsu.log.help(
- 'This error may be due to network connection problems'
- );
- } else {
- jitsu.log.info('The nodejitsu api reset the connection');
- jitsu.log.help(
- 'This error may be due to the application or the drone server'
- );
- }
-
- }
+ if (err.message && err.message === 'socket hang up' && err.code && err.code === 'ECONNRESET') {
+ jitsu.log.info('The nodejitsu api reset the connection');
+ jitsu.log.help('This error may be due to the application or the drone server');
+ } else if (err.message && err.message === 'ETIMEDOUT'){
+ jitsu.log.info(
+ 'jitsu\'s client request timed out before the server ' +
+ 'could respond. Please increase your client timeout');
+ jitsu.log.help('(Example: `jitsu config set timeout 100000`)');
+ jitsu.log.help('This error may be due to network connection problems');
} else {
err.stack.split('\n').forEach(function (trace) {
jitsu.log.error(trace);
Please sign in to comment.
Something went wrong with that request. Please try again.