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
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)
try:
return req.json()
except JSONDecodeError:
raise WikiException("Server did not return valid JSON.")
def main():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment