Add error handler
If the server fails to start, display error message and exit. Typically this is due to the address being in use.
This commit is contained in:
1 parent
251ebbcbac
commit
2b8e87f17f
1 file changed
+4
@@ -43,4 +43,8 @@ manager.on('ready', function() {
|
||||
server.listen(3000, function() {
|
||||
log.info('ol', 'Listening on http://localhost:3000/ (Ctrl+C to stop)');
|
||||
});
|
||||
server.on('error', function(err) {
|
||||
log.error('ol', 'Server failed to start: ' + err.message);
|
||||
process.exit(1);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user