Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

Commit

Permalink
add headers to error
Browse files Browse the repository at this point in the history
  • Loading branch information
yz01063552 committed Dec 16, 2021
1 parent e779065 commit e49660a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,13 +410,13 @@ func (client *Client) DoRequest(action *string, protocol *string, method *string
return _result, _err
}
res := util.AssertAsMap(obj)
res["_headers"] = response_.Headers
if tea.BoolValue(util.Is4xx(response_.StatusCode)) || tea.BoolValue(util.Is5xx(response_.StatusCode)) {
_err = tea.NewSDKError(map[string]interface{}{
"code": tea.ToString(DefaultAny(res["Code"], res["code"])),
"statusCode": tea.IntValue(response_.StatusCode),
"message": "code: " + tea.ToString(tea.IntValue(response_.StatusCode)) + ", " + tea.ToString(DefaultAny(res["Message"], res["message"])) + " request id: " + tea.ToString(DefaultAny(res["RequestId"], res["requestId"])),
"data": res,
"_headers": response_.Headers,
})
return _result, _err
}
Expand Down

0 comments on commit e49660a

Please sign in to comment.