unhandledRejection in app.js

This commit is contained in:
Romain Beaumont 2016-03-19 16:22:32 +01:00
parent fa8f94ce69
commit 6b365948ab
2 changed files with 3 additions and 3 deletions

3
app.js
View file

@ -14,3 +14,6 @@ catch(err) {
module.exports=mcServer.createMCServer(settings);
process.on('unhandledRejection', err => {
console.log(err.stack);
});

View file

@ -41,8 +41,5 @@ class MCServer extends EventEmitter {
this._server.on('error', error => this.emit('error',error));
this._server.on('listening', () => this.emit('listening',this._server.socketServer.address().port));
this.emit('asap');
//process.on('unhandledRejection', err => this.emit('error',err));
// TODO better catch all promises: using this make it impossible to run 2 servers in one process
}
}