From 2766769314162b1b2f8476248444231aaff71a1c Mon Sep 17 00:00:00 2001 From: ioito Date: Mon, 27 Jun 2022 10:14:05 +0800 Subject: [PATCH] fix(region): incloudsphere error --- pkg/multicloud/incloudsphere/sphere.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/multicloud/incloudsphere/sphere.go b/pkg/multicloud/incloudsphere/sphere.go index ae3ec880c5..08f3303771 100644 --- a/pkg/multicloud/incloudsphere/sphere.go +++ b/pkg/multicloud/incloudsphere/sphere.go @@ -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) {