improve error in sizeOf of serializer.js, fix remaining numerical id in createClient

This commit is contained in:
Romain Beaumont 2015-09-12 21:35:12 +02:00
parent 3b272159fd
commit 188848b364
2 changed files with 4 additions and 2 deletions

View File

@ -92,7 +92,7 @@ function createClient(options) {
}
function onKeepAlive(packet) {
client.write(0x00, {
client.write('keep_alive', {
keepAliveId: packet.keepAliveId
});
}

View File

@ -78,7 +78,9 @@ function createPacketBuffer(packetId, state, params, isServer) {
length += proto.sizeOf(params[fieldInfo.name], fieldInfo.type, params);
}, (e) => {
addErrorField(e, fieldInfo.name);
e.message = "sizeOf error for " + packetName + "." + e.field + " : " + e.message;
e.message = "sizeOf error for "+[state,direction,packetName,e.field].join(".")+"\n"+
" in packet 0x" + packetId.toString(16)+" "+JSON.stringify(params)+"\n"
+ e.message;
throw e;
});
});