Skip to content

Commit cb78bcc

Browse files
authored
Merge pull request #128 from pnhowe/master
handle non-dict error data in ResponseError
2 parents 29bfd53 + a4a5fbf commit cb78bcc

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
@@ -25,6 +25,8 @@ class ResponseError(Error):
2525
def __init__(self, resp, data, exception=None):
2626
if not data:
2727
msg = "(empty response)"
28+
elif not isinstance(data, dict):
29+
msg = str(data)
2830
elif "error" in data:
2931
msg = data["error"]
3032
elif "errors" in data:

0 commit comments

Comments
 (0)