From 39d8760f5fa7f5f0d1be963a207bfe51f1282102 Mon Sep 17 00:00:00 2001 From: Matthew R Date: Mon, 9 Aug 2021 14:37:45 -0400 Subject: [PATCH] logging --- src/class/Context.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/class/Context.ts b/src/class/Context.ts index 6e54f7b..47492ee 100644 --- a/src/class/Context.ts +++ b/src/class/Context.ts @@ -30,7 +30,11 @@ export default class Context { public send(v: string) { console.log(this.socket); - this.socket.write(`${v.toString()}\n`, (err) => err || this.client.signale.error(`Error occurred while writing: ${err}`)); + this.socket.write(`${v.toString()}\n`, (err) => { + if (err) { + this.client.signale.error(`Error occurred while writing: ${err}`); + } + }); this.socket.destroy(); } }