fix(region): incloudsphere error

This commit is contained in:
ioito
2022-06-27 10:14:05 +08:00
parent 84cdeff92b
commit 2766769314
+4 -1
View File
@@ -225,10 +225,13 @@ func (cli *SphereClient) __jsonRequest(method httputils.THttpMethod, res string,
req.SetHeader(header)
oe := &SphereError{}
_, resp, err := client.Send(context.Background(), req, oe, cli.debug)
if err != nil {
return nil, err
}
if resp.Contains("code") && resp.Contains("message") {
return nil, oe.ParseErrorFromJsonResponse(0, resp)
}
return resp, err
return resp, nil
}
func (self *SphereClient) GetSubAccounts() ([]cloudprovider.SSubAccount, error) {