Skip to content
This repository was archived by the owner on Mar 4, 2026. It is now read-only.

Commit 84c2bee

Browse files
authored
Merge pull request #92 from input-output-hk/packet-python-fixup
Adds fix for apis returning 'error' key
2 parents 007189c + c4aaa8c commit 84c2bee

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

packet/baseapi.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ class ResponseError(Error):
2323
def __init__(self, resp, data, exception=None):
2424
if not data:
2525
msg = "(empty response)"
26+
elif "error" in data:
27+
msg = data["error"]
2628
elif "errors" in data:
2729
msg = ", ".join(data["errors"])
2830
super().__init__("Error {0}: {1}".format(resp.status_code, msg), exception)

0 commit comments

Comments
 (0)