Skip to content

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

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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)