-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Description
It appears that when Tumblr is having issues, error responses can be different than expected.
I got the error: AttributeError: 'str' object has no attribute 'get'
Sentry recorded that content was a str instead of a dict. The status code was 504.
Relevant line: https://github.com/michaelhelmick/python-tumblpy/blob/master/tumblpy/api.py#L165
It seems like the easiest fix would be to check if the response was a str and if it was, use that for the error_message. Also, in looking at that code, it appears error_message gets written over for every error instead of being appended to. This seems like it could be fixed by ', '.join(content['errors']) instead of the loop.
If these seems like reasonable fixes, I'm happy to open a PR for them.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels