Merge pull request #155 from matrixgpt/feature/error-code

add error code to response
This commit is contained in:
bertybuttface 2023-04-14 16:34:49 +01:00 committed by GitHub
commit 31126af68f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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),