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(); } }