builder/digitalocean: don't panic if error contains no message [GH-492]
This commit is contained in:
parent
8821ef4def
commit
4067bab3d4
|
@ -3,6 +3,8 @@
|
|||
BUG FIXES:
|
||||
|
||||
* builder/all: timeout waiting for SSH connection is a failure. [GH-491]
|
||||
* builder/digitalocean: don't panic if erroneous API response doesn't
|
||||
contain error message. [GH-492]
|
||||
* builder/virtualbox: error if VirtualBox version cant be detected. [GH-488]
|
||||
* builder/virtualbox: detect if vboxdrv isn't properly setup. [GH-488]
|
||||
|
||||
|
|
|
@ -227,7 +227,13 @@ func NewRequest(d DigitalOceanClient, path string, params url.Values) (map[strin
|
|||
}
|
||||
|
||||
if status == "ERROR" {
|
||||
status = decodedResponse["message"].(string)
|
||||
statusRaw, ok := decodedResponse["message"]
|
||||
if ok {
|
||||
status = statusRaw.(string)
|
||||
} else {
|
||||
status = fmt.Sprintf(
|
||||
"Unknown error. Full response body: %s", body)
|
||||
}
|
||||
}
|
||||
|
||||
lastErr = errors.New(fmt.Sprintf("Received error from DigitalOcean (%d): %s",
|
||||
|
|
Loading…
Reference in New Issue