restore OAuth2 authentication error messages

This commit is contained in:
Mike Fährmann
2019-10-13 22:48:01 +02:00
parent 6779512fc7
commit df2b3c6888
2 changed files with 12 additions and 6 deletions

View File

@@ -974,11 +974,12 @@ class DeviantartAPI():
auth = (self.client_id, self.client_secret)
response = self.extractor.request(
url, method="POST", data=data, auth=auth)
url, method="POST", data=data, auth=auth, fatal=False)
data = response.json()
if response.status_code != 200:
raise exception.AuthenticationError('"{} ({})"'.format(
self.log.debug("Server response: %s", data)
raise exception.AuthenticationError('"{}" ({})'.format(
data.get("error_description"), data.get("error")))
if refresh_token:
_refresh_token_cache.update(refresh_token, data["refresh_token"])