Better logging for ugokiUpload failures

This commit is contained in:
Ceda EI 2021-09-27 23:53:59 +05:30
parent ce9611f079
commit 5ac1c1e4a6
1 changed files with 3 additions and 2 deletions

View File

@ -16,9 +16,10 @@ function ugokiUpload(axios, ugokiRoot, ctx, category, path) {
})
.catch((err) => {
if (err.response.status == 404)
console.error(err);
if (err.response && err.response.status == 404)
ctx.reply("Category doesn't exist");
else if (err.response.status == 409)
else if (err.response && err.response.status == 409)
ctx.reply("Already suggested / added.");
else
ctx.reply("No clue what the hell happened but adding suggestion failed.");