Project

General

Profile

Task #3127

Task #3126: Handle OpenAI API error codes

BE: Return the 500 error in the response of /answer api, if receive any error from openai.

Added by Ayush Khandelwal over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Immediate
Target version:
Start date:
07/13/2023
Due date:
07/24/2023
% Done:

100%

Estimated time:
2.00 h
Spent time:

Description

Server side
-----------
If error is 401 or 429, please log a critical level message; else log a info level message.

Log Message = "OpenAI error: <return error code and message from API call>"

At this time, send the error code as 500 to the frondend with the message "Unfortunately, ChatGPT Plus API Servers are very busy. Please retry later".

Also available in: Atom PDF