Skip to content

Commit

Permalink
fix: details are optional in API errors (#411)
Browse files Browse the repository at this point in the history
The ansible integrations tests for `certificate_info` were silently
failing because the `details` was missing from the API error.


https://dev.azure.com/ansible/hetzner.hcloud/_build/results?buildId=116526&view=logs&j=790943b1-2131-5e64-166b-e241853dcaf1&t=4ad41445-2459-50a0-f330-095184dc0a34&l=641
  • Loading branch information
jooola authored Jul 3, 2024
1 parent bce5e94 commit f1c6594
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion hcloud/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def request( # type: ignore[no-untyped-def]
raise APIException(
code=error["code"],
message=error["message"],
details=error["details"],
details=error.get("details"),
correlation_id=correlation_id,
)

Expand Down
1 change: 0 additions & 1 deletion tests/unit/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ def test_request_fails_correlation_id(self, client, response):
"error": {
"code": "conflict",
"message": "some conflict",
"details": None,
}
}
).encode("utf-8")
Expand Down

0 comments on commit f1c6594

Please sign in to comment.