Permalink
Browse files

Die on EADDRINUSE.

  • Loading branch information...
coreh committed Jan 14, 2012
1 parent 255b945 commit 654b78609a16fa3c49b502b26e95393ee2863af5
Showing with 10 additions and 0 deletions.
  1. +10 −0 server/server.js
View
@@ -68,6 +68,16 @@ exports.listen = function(port, host, username, password, downgrade, launchBrows
}
});
});
+
+ var serverErrorHandler = function(err) {
+ if (err.code == 'EADDRINUSE') {
+ console.error('Error: Address already in use. Try running nide under a different port.')
+ process.exit(-1)
+ }
+ }
+
+ server.on('error', serverErrorHandler);
+ staticServer.on('error', serverErrorHandler);
var nideUrl

0 comments on commit 654b786

Please sign in to comment.