hetznercloud / hcloud-go

A Go library for the Hetzner Cloud API
https://pkg.go.dev/github.com/hetznercloud/hcloud-go/v2/hcloud
MIT License
371 stars 45 forks source link

fix: `invalid_input` API errors may not return details [Backport release-1.x] #508

Closed github-actions[bot] closed 1 month ago

github-actions[bot] commented 1 month ago

The create uploaded certificate endpoint may return the following error:

{
  "error": {
    "code": "invalid_input",
    "message": "certificate must use larger key size"
  }
}

This change ensure that we do not get a json unmarshal error (unexpected end of json) while trying to parse a non-existing details data.


Backport ca78af2af8acd375460c0f9705ea9d62d5ee1cc4 from #507.

BEGIN_COMMIT_OVERRIDE fix: invalid_input API errors may not return details END_COMMIT_OVERRIDE