fix: replace NewError with NewOpenAIError for improved error handling in multiple handlers

This commit is contained in:
CaIon
2025-07-19 11:29:31 +08:00
parent d19a6914f9
commit a3059597fb
5 changed files with 5 additions and 5 deletions

View File

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