fix: packets

This commit is contained in:
cha0s 2020-12-11 12:09:58 -06:00
parent e0cebbf865
commit 3d7db1a001
2 changed files with 7 additions and 2 deletions

View File

@ -23,7 +23,7 @@ export default (latus, [name, Packet]) => class LimitedPacket extends Packet {
throw error; throw error;
} }
if (super.validate) { if (super.validate) {
super.validate(packet, socket); await super.validate(packet, socket);
} }
} }

View File

@ -34,7 +34,12 @@ export default {
return; return;
} }
if (error instanceof Error) { if (error instanceof Error) {
fn({code: 500, ...('production' === NODE_ENV ? {} : {stack: error.stack})}); fn({
code: error.code || 500,
reason: error.message,
...('production' === NODE_ENV ? {} : {stack: error.stack}),
});
return;
} }
fn(error); fn(error);
} }