From 9c1ffdbb82257781380f5d4a0ad05835cf7d7406 Mon Sep 17 00:00:00 2001 From: Ovear Date: Thu, 1 Dec 2022 21:48:19 +0800 Subject: [PATCH] fix(aliyundrive): return error if got wrong http code (#2543) --- drivers/aliyundrive/util.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/aliyundrive/util.go b/drivers/aliyundrive/util.go index 9f4c1cdc..8eb23d81 100644 --- a/drivers/aliyundrive/util.go +++ b/drivers/aliyundrive/util.go @@ -62,6 +62,8 @@ func (d *AliDrive) request(url, method string, callback base.ReqCallback, resp i return d.request(url, method, callback, resp) } return nil, errors.New(e.Message), e + } else if res.IsError() { + return nil, errors.New("bad status code " + res.Status()), e } return res.Body(), nil, e }