Catch ErrorResponse json.dumps error

This commit is contained in:
miruka 2019-07-23 14:48:37 -04:00
parent 9397687122
commit 345b17b21f

View File

@ -301,7 +301,10 @@ class MatrixClient(nio.AsyncClient):
async def onErrorResponse(self, resp: nio.ErrorResponse) -> None:
# TODO: show something in the client
log.warning("%s - %s", resp, json.dumps(resp.__dict__, indent=4))
try:
log.warning("%s - %s", resp, json.dumps(resp.__dict__, indent=4))
except Exception:
log.warning(repr(resp))
# Callbacks for nio events