import jsondecodeerror seperately since its not in ujson

This commit is contained in:
Kevin Froman 2020-04-03 04:33:30 -05:00
parent 919ab12b76
commit 39d0be32ac
6 changed files with 15 additions and 9 deletions

View file

@ -4,6 +4,7 @@ HTTP endpoints for communicating with peers
"""
import sys
import os
from json import JSONDecodeError
import deadsimplekv as simplekv
import ujson as json
@ -50,7 +51,7 @@ def sendto():
"""Endpoint peers send chat messages to"""
try:
msg = request.get_json(force=True)
except json.JSONDecodeError:
except JSONDecodeError:
msg = ''
else:
msg = json.dumps(msg)