client.end should have a string argument, not an Error object.

This commit is contained in:
Robin Lambertz 2013-01-29 11:05:10 +00:00
parent 997071ef41
commit d6b3a91751

View File

@ -29,7 +29,7 @@ Client.prototype.setSocket = function(socket) {
while (true) {
parsed = parsePacket(incomingBuffer, self.isServer);
if (! parsed) break;
if (parsed.error) this.end(parsed.error);
if (parsed.error) this.end(parsed.error.message);
packet = parsed.results;
incomingBuffer = incomingBuffer.slice(parsed.size);
self.emit(packet.id, packet);