From 5ac1c1e4a6c432e9920dcda9641904a956aafe02 Mon Sep 17 00:00:00 2001 From: Ceda EI Date: Mon, 27 Sep 2021 23:53:59 +0530 Subject: [PATCH] Better logging for ugokiUpload failures --- commands/suggest.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/commands/suggest.js b/commands/suggest.js index 3f5c62d..18ac6d9 100644 --- a/commands/suggest.js +++ b/commands/suggest.js @@ -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.");