Skip to content
Snippets Groups Projects
Commit dbdc4399 authored by Robin Sonnabend's avatar Robin Sonnabend
Browse files

Catch JSONDecodeError in wiki.py

Fix #193
parent 5f051d53
No related branches found
No related tags found
No related merge requests found
import requests import requests
from json import JSONDecodeError
import config import config
...@@ -117,7 +118,10 @@ class WikiClient: ...@@ -117,7 +118,10 @@ class WikiClient:
"HTTP status code {} on action {}.".format( "HTTP status code {} on action {}.".format(
req.status_code, action)) req.status_code, action))
self.cookies.update(req.cookies) self.cookies.update(req.cookies)
try:
return req.json() return req.json()
except JSONDecodeError:
raise WikiException("Server did not return valid JSON.")
def main(): def main():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment