Skip to content

Commit

Permalink
fix: details are optional in API errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jooola committed Jul 3, 2024
1 parent cf08842 commit c3050f9
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"),
trace_id=trace_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_trace_id(self, client, response):
"error": {
"code": "conflict",
"message": "some conflict",
"details": None,
}
}
).encode("utf-8")
Expand Down

0 comments on commit c3050f9

Please sign in to comment.