mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-10-16 08:04:10 +00:00
fix: fix error response (close #468)
This commit is contained in:
@@ -317,8 +317,7 @@ func relayTextHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode {
|
||||
isStream = isStream || strings.HasPrefix(resp.Header.Get("Content-Type"), "text/event-stream")
|
||||
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
return errorWrapper(
|
||||
fmt.Errorf("bad status code: %d", resp.StatusCode), "bad_status_code", resp.StatusCode)
|
||||
return relayErrorHandler(resp)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user