From 8863fa60509b2bce2c3d3cc9ac1a765db29e4459 Mon Sep 17 00:00:00 2001 From: supositware Date: Thu, 4 Mar 2021 13:34:49 +0100 Subject: [PATCH] Handle error --- commands/utility/download.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/commands/utility/download.js b/commands/utility/download.js index 1e95b45..8fed201 100644 --- a/commands/utility/download.js +++ b/commands/utility/download.js @@ -114,7 +114,11 @@ class DownloadCommand extends Command { message.channel.send({ embed: Embed, files: [`${os.tmpdir()}/${message.id}compressed.mp4`] - }); + }) + .catch(err => { + console.error(err); + return message.channel.send(`${err.name}: ${err.message} ${err.message === 'Request entity too large' ? 'The file size is too big' : ''}`); + }); }); } else { retry++;