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 386c254682
commit b85106b571
2 changed files with 9 additions and 1 deletions
+1 -1
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")