Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
protokollsystem
proto3
Commits
dbdc4399
Commit
dbdc4399
authored
Mar 20, 2018
by
Robin Sonnabend
Browse files
Catch JSONDecodeError in wiki.py
Fix
#193
parent
5f051d53
Changes
1
Hide whitespace changes
Inline
Side-by-side
wiki.py
View file @
dbdc4399
import
requests
from
json
import
JSONDecodeError
import
config
...
...
@@ -117,7 +118,10 @@ class WikiClient:
"HTTP status code {} on action {}."
.
format
(
req
.
status_code
,
action
))
self
.
cookies
.
update
(
req
.
cookies
)
return
req
.
json
()
try
:
return
req
.
json
()
except
JSONDecodeError
:
raise
WikiException
(
"Server did not return valid JSON."
)
def
main
():
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment