diff --git a/pkg/coach-client/client_us.go b/pkg/coach-client/client_us.go index 814d73d..d6918b9 100644 --- a/pkg/coach-client/client_us.go +++ b/pkg/coach-client/client_us.go @@ -3,14 +3,15 @@ package coach_client import ( "context" "fmt" + "log/slog" + "net/url" + "time" + "gitea.timerzz.com/kedaya_haitao/common/pkg/proxy" restry_pool "gitea.timerzz.com/kedaya_haitao/common/pkg/restry-pool" "github.com/go-resty/resty/v2" "github.com/pkg/errors" proxy2 "github.com/timerzz/proxypool/pkg/proxy" - "log/slog" - "net/url" - "time" ) type US struct { @@ -36,7 +37,10 @@ func tryRequest(ctx context.Context, urlPath string, respData any, proxyGetter f default: } - _, err := callByProxy(ctx, p, urlPath, respData) + 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