Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
DuniterPy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
python
DuniterPy
Commits
59cb3182
Commit
59cb3182
authored
9 years ago
by
inso
Browse files
Options
Downloads
Patches
Plain Diff
Handle bad json
parent
292190f2
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
duniterpy/api/bma/api.py
+1
-1
1 addition, 1 deletion
duniterpy/api/bma/api.py
with
1 addition
and
1 deletion
duniterpy/api/bma/api.py
+
1
−
1
View file @
59cb3182
...
@@ -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
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment