BigW Consortium Gitlab

Commit ce27820c by Marc Abramowitz

Raise an exception with the Etsy response text when we failed to decode it as JSON.

parent 78e4dbfe
......@@ -327,7 +327,11 @@ class API(object):
self.log('API._get: http_method = %r, url = %r, data = %r' % (http_method, url, data))
self.data = self.decode(data)
try:
self.data = self.decode(data)
except json.JSONDecodeError:
raise ValueError('Could not decode response from Etsy as JSON: %r' % data)
self.count = self.data['count']
return self.data['results']
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment