Skip to content
Snippets Groups Projects
Commit 72fc1e99 authored by inso's avatar inso
Browse files

Fix duniter version

parent a08ecaf4
No related branches found
No related tags found
No related merge requests found
...@@ -122,7 +122,7 @@ class API(object): ...@@ -122,7 +122,7 @@ class API(object):
data = json.loads(text) data = json.loads(text)
jsonschema.validate(data, self.schema) jsonschema.validate(data, self.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")
def parse_error(self, text): def parse_error(self, text):
...@@ -150,7 +150,7 @@ class API(object): ...@@ -150,7 +150,7 @@ class API(object):
data = await response.json() data = await response.json()
jsonschema.validate(data, self.schema) jsonschema.validate(data, self.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 requests_get(self, session, path, **kwargs): async def requests_get(self, session, path, **kwargs):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment