fix: err 如果是 newApiErr 则保留

This commit is contained in:
Xyfacai
2025-09-10 15:31:35 +08:00
parent fcdfd027cd
commit 27a0a447d0
2 changed files with 33 additions and 4 deletions

View File

@@ -264,9 +264,8 @@ func doRequest(c *gin.Context, req *http.Request, info *common.RelayInfo) (*http
}
resp, err := client.Do(req)
if err != nil {
return nil, err
return nil, types.NewError(err, types.ErrorCodeDoRequestFailed, types.ErrOptionWithHideErrMsg("upstream error: do request failed"))
}
if resp == nil {
return nil, errors.New("resp is nil")