Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

add error code to response #155

Merged
merged 1 commit into from
Apr 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down