fix handle_exc

This commit is contained in:
Evgeny Zinoviev 2021-05-23 00:16:48 +03:00
parent c23be0f78d
commit b37fb36735

View File

@ -84,7 +84,10 @@ def handle_exc(update: Update, e) -> None:
logging.exception(str(e))
if isinstance(e, InverterError):
try:
err = json.loads(str(e))['message']
except json.decoder.JSONDecodeError:
err = str(e)
reply(update, f'<b>Error:</b> {err}')
elif not isinstance(e, TimedOut):