Better error handling for when website cannot start listening on configured port
This commit is contained in:
parent
3fb907f682
commit
57462c3de1
|
@ -274,9 +274,15 @@ module.exports = function(logger){
|
|||
res.send(500, 'Something broke!');
|
||||
});
|
||||
|
||||
app.listen(portalConfig.website.port, function(){
|
||||
logger.debug(logSystem, 'Server', 'Website started on port ' + portalConfig.website.port);
|
||||
});
|
||||
try {
|
||||
app.listen(portalConfig.website.port, function () {
|
||||
logger.debug(logSystem, 'Server', 'Website started on port ' + portalConfig.website.port);
|
||||
});
|
||||
}
|
||||
catch(e){
|
||||
logger.error(logSystem, 'Server', 'Could not start website on port ' + portalConfig.website.port
|
||||
+ ' - its either in use or you do not have permission');
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue