diff options
Diffstat (limited to 'mastodon')
-rw-r--r-- | mastodon/Mastodon.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index 2f84635..83a8081 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py | |||
@@ -1227,7 +1227,9 @@ class Mastodon: | |||
1227 | 1227 | ||
1228 | # See if the returned dict is an error dict even though status is 200 | 1228 | # See if the returned dict is an error dict even though status is 200 |
1229 | if isinstance(response, dict) and 'error' in response: | 1229 | if isinstance(response, dict) and 'error' in response: |
1230 | raise MastodonAPIError("Mastodon API returned error: " + str(response['error'])) | 1230 | if not isinstance(response['error'], six.string_types): |
1231 | response['error'] = six.text_type(response['error']) | ||
1232 | raise MastodonAPIError("Mastodon API returned error: " + response['error']) | ||
1231 | 1233 | ||
1232 | # Parse link headers | 1234 | # Parse link headers |
1233 | if isinstance(response, list) and \ | 1235 | if isinstance(response, list) and \ |