Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Commit

Permalink
Merge pull request hashicorp#3659 from boumenot/pr-certificate-nil-ref
Browse files Browse the repository at this point in the history
azure: handle non-OK responses for key vault
  • Loading branch information
boumenot authored Jun 29, 2016
2 parents 97b536e + fed72de commit 63edbd4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions builder/azure/common/vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package common

import (
"fmt"
"net/http"
"strings"

Expand Down Expand Up @@ -60,6 +61,15 @@ func (client *VaultClient) GetSecret(vaultName, secretName string) (*Secret, err
return nil, err
}

if resp.StatusCode != 200 {
return nil, fmt.Errorf(
"Failed to fetch secret from %s/%s, HTTP status code=%d (%s)",
vaultName,
secretName,
resp.StatusCode,
http.StatusText(resp.StatusCode))
}

var secret Secret

err = autorest.Respond(
Expand Down

0 comments on commit 63edbd4

Please sign in to comment.