Change str() to encode('utf-8')
Some error don't be displayed with Mastodon.py because it can't convert ascii with str(). So I change str to encode(utf-8)
This commit is contained in:
pare
5b811b719d
commit
26baa3b1b1
S'han modificat 1 arxius amb 1 adicions i 1 eliminacions
|
@ -1190,7 +1190,7 @@ class Mastodon:
|
|||
raise MastodonAPIError('Endpoint not found.')
|
||||
|
||||
if isinstance(response, dict) and 'error' in response:
|
||||
raise MastodonAPIError("Mastodon API returned error: " + str(response['error']))
|
||||
raise MastodonAPIError("Mastodon API returned error: " + response['error'].encode('utf-8').strip())
|
||||
else:
|
||||
raise MastodonAPIError('Endpoint not found.')
|
||||
|
||||
|
|
Loading…
Referencia en una nova incidència