Commit 0ff78b07 by JustSong

chore: update error code

parent 8c779729
...@@ -29,7 +29,7 @@ func GetSubscription(c *gin.Context) { ...@@ -29,7 +29,7 @@ func GetSubscription(c *gin.Context) {
if err != nil { if err != nil {
openAIError := OpenAIError{ openAIError := OpenAIError{
Message: err.Error(), Message: err.Error(),
Type: "one_api_error", Type: "upstream_error",
} }
c.JSON(200, gin.H{ c.JSON(200, gin.H{
"error": openAIError, "error": openAIError,
......
...@@ -146,7 +146,7 @@ func relayErrorHandler(resp *http.Response) (openAIErrorWithStatusCode *OpenAIEr ...@@ -146,7 +146,7 @@ func relayErrorHandler(resp *http.Response) (openAIErrorWithStatusCode *OpenAIEr
StatusCode: resp.StatusCode, StatusCode: resp.StatusCode,
OpenAIError: OpenAIError{ OpenAIError: OpenAIError{
Message: fmt.Sprintf("bad response status code %d", resp.StatusCode), Message: fmt.Sprintf("bad response status code %d", resp.StatusCode),
Type: "one_api_error", Type: "upstream_error",
Code: "bad_response_status_code", Code: "bad_response_status_code",
Param: strconv.Itoa(resp.StatusCode), Param: strconv.Itoa(resp.StatusCode),
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment