[deviantart] handle decode errors for extended_fetch results (#655)

This isn't going to solve the underlying problem, but it should at
least provide the server response when those errors happen.
This commit is contained in:
Mike Fährmann
2020-03-24 20:49:54 +01:00
parent 88ebbadc58
commit 1b82d36ab2

View File

@@ -1044,7 +1044,10 @@ class DeviantartAPI():
if response.status_code == 404:
raise exception.StopExtraction(
"Your account must use the Eclipse interface.")
return response.json()
try:
return response.json()
except Exception:
return {"error": response.text}
def deviation_metadata(self, deviations):
""" Fetch deviation metadata for a set of deviations"""