mirror of
https://github.com/matrixgpt/matrix-chatgpt-bot.git
synced 2024-10-01 01:25:41 -04:00
Merge pull request #91 from max298/feature/send-error
Show errors from OpenAI
This commit is contained in:
commit
43dc126241
@ -122,7 +122,11 @@ export default class CommandHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
const result = await sendChatGPTMessage(this.chatGPT, await bodyWithoutPrefix, storedConversation);
|
||||
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);
|
||||
});
|
||||
await Promise.all([
|
||||
this.client.setTyping(roomId, false, 500),
|
||||
sendReply(this.client, roomId, this.getRootEventId(event), `${result.response}`, MATRIX_THREADS, MATRIX_RICH_TEXT)
|
||||
|
Loading…
Reference in New Issue
Block a user