From 1aeb51eb7aefa3328f609c8a6bc720e3a1611682 Mon Sep 17 00:00:00 2001 From: Bsian Date: Tue, 12 May 2020 17:10:34 +0100 Subject: [PATCH] Attempt at a fix? --- src/class/Util.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/class/Util.ts b/src/class/Util.ts index 25819f2..a79c0cc 100644 --- a/src/class/Util.ts +++ b/src/class/Util.ts @@ -37,8 +37,6 @@ export default class Util { let output = ''; const writeFunction = (data: string|Buffer|Error) => { if (data instanceof Error) error = true; - if (data instanceof Error) this.client.getDMChannel('253600545972027394').then((c) => c.createMessage('error')); - this.client.getDMChannel('253600545972027394').then((c) => c.createMessage(data.toString())); output += `${data}`; }; const cmd = childProcess.exec(command, options); @@ -49,7 +47,7 @@ export default class Util { cmd.stdout.off('data', writeFunction); cmd.stderr.off('data', writeFunction); cmd.off('error', writeFunction); - if (error) rej(new Error(output)); + if (code !== 0) rej(new Error(output)); res(output); }); });