Skip to content

Commit 3f3ae83

Browse files
author
martin-doyle
committed
Revert "Revert "Catch exception on server start""
This reverts commit 59f875e.
1 parent 59f875e commit 3f3ae83

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

lib/server.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,12 @@ function Server(opts, callback) {
216216
var server = interfaces.serverFactory(iface, fallback, that);
217217
that.servers.push(server);
218218
server.maxConnections = iface.maxConnections || 10000000;
219+
220+
// Catch listen errors
221+
server.on('error', function (e) {
222+
that.logger.error('Error starting Mosca Server');
223+
that.emit('error', e);
224+
});
219225
server.listen(port, host, dn);
220226
}, done);
221227
},

0 commit comments

Comments
 (0)