catch fail file download

This commit is contained in:
SowinskiBraeden committed 2023-04-13 20:04:29 -07:00
1 parent e4cb583420
commit d958793a00
1 file changed
+5
+5
View File
@@ -16,6 +16,11 @@ module.exports = {
).then(res => res);
const stream = fs.createWriteStream(outputDir);
if (!res.data.token) {
client.error(`Error downloading File "${filename}":`);
client.error(res);
return;
}
const { body } = await fetch(res.data.token.url);
await finished(Readable.fromWeb(body).pipe(stream));
},