Skip to content
Snippets Groups Projects
Commit 59cb3182 authored by inso's avatar inso
Browse files

Handle bad json

parent 292190f2
No related branches found
No related tags found
No related merge requests found
...@@ -136,7 +136,7 @@ class API(object): ...@@ -136,7 +136,7 @@ class API(object):
data = json.loads(text) data = json.loads(text)
jsonschema.validate(data, self.error_schema) jsonschema.validate(data, self.error_schema)
return data return data
except TypeError: except (TypeError, json.decoder.JSONDecodeError):
raise jsonschema.ValidationError("Could not parse json") raise jsonschema.ValidationError("Could not parse json")
async def parse_response(self, response): async def parse_response(self, response):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment