From 6576fc3d8431c6fcc351e934d391f47c60d875a3 Mon Sep 17 00:00:00 2001 From: Max Kammler Date: Tue, 11 Apr 2023 11:40:50 +0200 Subject: [PATCH] add error code to response --- src/handlers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/handlers.ts b/src/handlers.ts index d418e0e..fb96e64 100644 --- a/src/handlers.ts +++ b/src/handlers.ts @@ -127,7 +127,7 @@ export default class CommandHandler { const result = await sendChatGPTMessage(this.chatGPT, await bodyWithoutPrefix, storedConversation) .catch((error) => { LogService.error(`OpenAI-API Error: ${error}`); - sendError(this.client, "The bot has encountered an error, please contact your administrator.", roomId, event.event_id); + sendError(this.client, `The bot has encountered an error, please contact your administrator (Error code ${error.status || "Unknown"}).`, roomId, event.event_id); }); await Promise.all([ this.client.setTyping(roomId, false, 500),