From 960c340760c242b1419d6a5f2d5cc3a978d26216 Mon Sep 17 00:00:00 2001 From: Wroclaw Date: Wed, 22 Mar 2023 06:40:16 +0100 Subject: [PATCH] Log more more information on error (origin, type) also fix the emoji in embed sent in reply --- src/index.ts | 3 ++- src/moderation.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 0117606..380063b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -61,12 +61,13 @@ discord.on("messageCreate", async message => { message.react("😶"); } } catch (e) { + console.error(`Error ocurred while handling chat completion request (${(e as object).constructor.name}):`); console.error(e); message.reply({ embeds: [{ color: 0xff0000, - description: "Something bad happened! :frown:" + description: "Something bad happened! :frowning:" }], allowedMentions: { repliedUser: false, diff --git a/src/moderation.ts b/src/moderation.ts index a7ce63c..02b2540 100644 --- a/src/moderation.ts +++ b/src/moderation.ts @@ -30,7 +30,8 @@ export default class Moderation { return flagged; } catch (e) { - console.log(e); + console.error(`Error occured while handling moderation request (${(e as object).constructor.name}):`); + console.error(e); return false; } }