Initial redo of exceptions

This commit is contained in:
Mads Marquart
2020-01-15 10:49:16 +01:00
parent 656281eacb
commit 3445eccc32
8 changed files with 101 additions and 114 deletions

View File

@@ -38,10 +38,8 @@ def response_to_json(content):
content = _util.strip_json_cruft(content) # Usually only needed in some error cases
try:
j = json.loads(content, cls=ConcatJSONDecoder)
except Exception:
raise _exception.FBchatException(
"Error while parsing JSON: {!r}".format(content)
)
except Exception as e:
raise _exception.ParseError("Error while parsing JSON", data=content) from e
rtn = [None] * (len(j))
for x in j: