From c2339c07c4e2540ed6cbe30816018b2548bc7c86 Mon Sep 17 00:00:00 2001 From: timerzz Date: Fri, 26 Jul 2024 15:22:16 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BF=AE=E6=94=B9=E9=87=8D=E8=AF=95?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/coach-client/client_us.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/coach-client/client_us.go b/pkg/coach-client/client_us.go index d6918b9..f36e210 100644 --- a/pkg/coach-client/client_us.go +++ b/pkg/coach-client/client_us.go @@ -38,13 +38,14 @@ func tryRequest(ctx context.Context, urlPath string, respData any, proxyGetter f } resp, err := callByProxy(ctx, p, urlPath, respData) - if resp.StatusCode() != 200 { - err = fmt.Errorf("请求错误:%d, %s", resp.StatusCode(), resp.Body()) - } if err != nil { slog.Debug(err.Error()) continue } + if resp.StatusCode() != 200 { + slog.Debug(fmt.Errorf("请求错误:%d, %s", resp.StatusCode(), resp.Body()).Error()) + continue + } return nil } return errors.New("未获取到可用的代理")