Handle error

This commit is contained in:
supositware 2021-03-04 13:34:49 +01:00
parent 57ad39102f
commit 8863fa6050

View file

@ -114,7 +114,11 @@ class DownloadCommand extends Command {
message.channel.send({ message.channel.send({
embed: Embed, embed: Embed,
files: [`${os.tmpdir()}/${message.id}compressed.mp4`] 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 { } else {
retry++; retry++;