mirror of
https://gitlab.com/chicken-riders/RcGcDb.git
synced 2025-02-23 00:54:09 +00:00
Handle a case where returned body is empty
This commit is contained in:
parent
052598ddfa
commit
4c82458ca2
|
@ -382,7 +382,11 @@ class Wiki:
|
||||||
else:
|
else:
|
||||||
# JSON Extraction
|
# JSON Extraction
|
||||||
try:
|
try:
|
||||||
request_json = self.parse_mw_request_info(await request.json(encoding="UTF-8"), str(request.url))
|
request_json = await request.json(encoding="UTF-8")
|
||||||
|
if request_json is None: # Nothing in the body?
|
||||||
|
logger.error("{} returned empty body: {}".format(self.script_url, await request.text()))
|
||||||
|
raise ServerError
|
||||||
|
request_json = self.parse_mw_request_info(request_json, str(request.url))
|
||||||
for item in json_path:
|
for item in json_path:
|
||||||
request_json = request_json[item]
|
request_json = request_json[item]
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
|
Loading…
Reference in a new issue