mirror of
https://github.com/matrixgpt/matrix-chatgpt-bot.git
synced 2024-09-30 04:55:44 +00:00
pass OpenAI error directly to user
This commit is contained in:
parent
cc344c93d9
commit
11b042a8c3
@ -122,7 +122,12 @@ export default class CommandHandler {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const result = await sendChatGPTMessage(this.chatGPT, await bodyWithoutPrefix, storedConversation);
|
const result = await sendChatGPTMessage(this.chatGPT, await bodyWithoutPrefix, storedConversation)
|
||||||
|
.catch((error) => {
|
||||||
|
LogService.warn(`OpenAPI Error: ${error}`);
|
||||||
|
sendError(this.client, "Sorry, there was an error using the OpenAI-API. Details: " + error, roomId, event.event_id);
|
||||||
|
return;
|
||||||
|
});
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
this.client.setTyping(roomId, false, 500),
|
this.client.setTyping(roomId, false, 500),
|
||||||
sendReply(this.client, roomId, this.getRootEventId(event), `${result.response}`, MATRIX_THREADS, MATRIX_RICH_TEXT)
|
sendReply(this.client, roomId, this.getRootEventId(event), `${result.response}`, MATRIX_THREADS, MATRIX_RICH_TEXT)
|
||||||
|
Loading…
Reference in New Issue
Block a user