fix: create NewOpenAIError function for improved error handling in Relay

This commit is contained in:
CaIon
2025-07-19 11:28:18 +08:00
parent 4313ede132
commit d19a6914f9
2 changed files with 9 additions and 1 deletions

View File

@@ -210,7 +210,7 @@ func TextHelper(c *gin.Context) (newAPIError *types.NewAPIError) {
resp, err := adaptor.DoRequest(c, relayInfo, requestBody)
if err != nil {
return types.NewError(err, types.ErrorCodeDoRequestFailed)
return types.NewOpenAIError(err, types.ErrorCodeDoRequestFailed, http.StatusInternalServerError)
}
statusCodeMappingStr := c.GetString("status_code_mapping")