Skip to content

Commit

Permalink
Executes callback when connection refused or reset
Browse files Browse the repository at this point in the history
  • Loading branch information
agsh committed Jun 19, 2016
1 parent 0ae7b66 commit ce1e4eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/cam.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,10 @@ Cam.prototype._request = function(options, callback) {
}
/* address, port number or IPCam error */
if (err.code === 'ECONNREFUSED' && err.errno === 'ECONNREFUSED' && err.syscall === 'connect') {
console.error(err);
callback(err);
/* network error */
} else if (err.code === 'ECONNRESET' && err.errno === 'ECONNRESET' && err.syscall === 'read') {
console.error(err);
callback(err);
} else {
callback(err);
}
Expand Down

0 comments on commit ce1e4eb

Please sign in to comment.