Skip to content

Commit

Permalink
fix: Add error handling for missing role in OpenAIClient.js (danny-av…
Browse files Browse the repository at this point in the history
  • Loading branch information
danny-avila authored and Rasukarusan committed Dec 16, 2023
1 parent 04eebc3 commit 0eac4c0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions api/app/clients/OpenAIClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,7 @@ ${convo}
) ||
err?.message?.includes('The server had an error processing your request') ||
err?.message?.includes('missing finish_reason') ||
err?.message?.includes('missing role') ||
(err instanceof OpenAI.OpenAIError && err?.message?.includes('missing finish_reason'))
) {
logger.error('[OpenAIClient] Known OpenAI error:', err);
Expand Down

0 comments on commit 0eac4c0

Please sign in to comment.