Emit packet handling errors to the error event and not the debug event

This commit is contained in:
Amish Shah
2017-05-01 07:56:13 +01:00
committed by GitHub
parent c3be798663
commit 892ba67d71

View File

@@ -99,8 +99,11 @@ class WebSocketPacketManager {
}
if (!queue && this.queue.length > 0) this.handleQueue();
if (this.handlers[packet.t]) return this.handlers[packet.t].handle(packet);
try {
if (this.handlers[packet.t]) return this.handlers[packet.t].handle(packet);
} catch (error) {
this.client.emit(Constants.Events.ERROR, error);
}
return false;
}
}