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:
@@ -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