Commit dbdc4399 authored by Robin Sonnabend's avatar Robin Sonnabend

Catch JSONDecodeError in wiki.py

Fix #193
parent 5f051d53
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():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment