From b3458b505292e5140ac9b9091b94f77786d6230e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AD=90=E9=93=AD?= Date: Mon, 18 Nov 2024 13:36:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=A1=E5=AF=86=EF=BC=8C=E7=9B=B4=E5=85=85?= =?UTF-8?q?=EF=BC=8C=E5=9B=9E=E8=B0=83=20resp.StatusCode=20!=3D=20200?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dctw/v1/core/core.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dctw/v1/core/core.go b/dctw/v1/core/core.go index e5314dd..d85607a 100644 --- a/dctw/v1/core/core.go +++ b/dctw/v1/core/core.go @@ -188,6 +188,9 @@ func (c *DctWServer) Request(_ context.Context, request DctWRequest, path string fmt.Printf("resp.body:%s\n", string(bodyBytes)) fmt.Printf("resp.headers:%+v\n", resp.Header) } + if resp.StatusCode != 200 { + return nil, fmt.Errorf("请求异常:%s", resp.Status) + } return bodyBytes, nil }