Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

handle failed connections

  • Loading branch information...
commit 35e1a0714ac61c63f3fb89e9ab29427a19184e92 1 parent 1a19a92
@rejetto authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 cli.js
View
9 cli.js
@@ -21,13 +21,18 @@ socket.on('connect', function () {
socket.emit('vfs.add', {uri:under, resource:fpath, depth:1}, function(data){
if (!data) {
log('communication error');
- process.exit(1);
+ process.exit(2);
}
if (!data.ok) {
log('error: '+(data.error || 'generic'));
- process.exit(2);
+ process.exit(3);
}
socket.disconnect();
process.exit(0);
});
});
+
+socket.socket.on('error', function(err){
+ log('Server unreachable');
+ process.exit(1);
+});
Please sign in to comment.
Something went wrong with that request. Please try again.