Skip to content

Commit

Permalink
prevent silent user errors during onCreate and onJoin. bump 0.11.8
Browse files Browse the repository at this point in the history
  • Loading branch information
endel committed Aug 28, 2019
1 parent dd83ff7 commit 2f9e475
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "colyseus",
"version": "0.11.7",
"version": "0.11.8",
"description": "Multiplayer Game Server for Node.js.",
"main": "./lib/index.js",
"typings": "./lib/index.d.ts",
Expand Down
1 change: 1 addition & 0 deletions src/MatchMaker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ export class MatchMaker {
await room.onCreate(merge({}, clientOptions, registeredHandler.options));

} catch (e) {
debugAndPrintError(e);
throw new MatchMakeError(e.message, Protocol.ERR_MATCHMAKE_UNHANDLED);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Room.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ export abstract class Room<T= any> extends EventEmitter {
await this.onJoin(client, options, client.auth);
}
} catch (e) {
debugError(e);
debugAndPrintError(e);
throw e;

} finally {
Expand Down
4 changes: 2 additions & 2 deletions src/Server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import net from 'net';
import WebSocket from 'ws';
import { ServerOptions as IServerOptions } from 'ws';

import { debugAndPrintError, debugMatchMaking } from './Debug';
import { debugAndPrintError, debugError, debugMatchMaking } from './Debug';
import { MatchMaker } from './MatchMaker';
import { RegisteredHandler } from './matchmaker/RegisteredHandler';
import { Presence } from './presence/Presence';
Expand Down Expand Up @@ -102,7 +102,7 @@ export class Server {
await this.onShutdownCallback();

} catch (e) {
debugAndPrintError(`error during shutdown: ${e}`)
debugAndPrintError(`error during shutdown: ${e}`);

} finally {
if (exit) { process.exit(); }
Expand Down

0 comments on commit 2f9e475

Please sign in to comment.