mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-24 21:24:05 -08:00
[FIX] Azure DS: Return error when request failed (#4719)
This fixes the issue that the error is swallowed when the request failed. Signed-off-by: Jannick Fahlbusch <git@jf-projects.de>
This commit is contained in:
parent
1dd57765b4
commit
63f375e80a
|
@ -551,13 +551,12 @@ func (client *azureClient) getNetworkInterfaceByID(networkInterfaceID string) (*
|
||||||
|
|
||||||
resp, err := client.nic.GetSender(req)
|
resp, err := client.nic.GetSender(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
result.Response = autorest.Response{Response: resp}
|
|
||||||
return nil, autorest.NewErrorWithError(err, "network.InterfacesClient", "Get", resp, "Failure sending request")
|
return nil, autorest.NewErrorWithError(err, "network.InterfacesClient", "Get", resp, "Failure sending request")
|
||||||
}
|
}
|
||||||
|
|
||||||
result, err = client.nic.GetResponder(resp)
|
result, err = client.nic.GetResponder(resp)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
err = autorest.NewErrorWithError(err, "network.InterfacesClient", "Get", resp, "Failure responding to request")
|
return nil, autorest.NewErrorWithError(err, "network.InterfacesClient", "Get", resp, "Failure responding to request")
|
||||||
}
|
}
|
||||||
|
|
||||||
return &result, nil
|
return &result, nil
|
||||||
|
|
Loading…
Reference in a new issue