fix(aliyundrive): return error if got wrong http code (#2543)

pull/2555/head
Ovear 2022-12-01 21:48:19 +08:00 committed by GitHub
parent 18a63e34dd
commit 9c1ffdbb82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -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
}