fix handle_exc
This commit is contained in:
parent
c23be0f78d
commit
b37fb36735
@ -84,7 +84,10 @@ def handle_exc(update: Update, e) -> None:
|
||||
logging.exception(str(e))
|
||||
|
||||
if isinstance(e, InverterError):
|
||||
err = json.loads(str(e))['message']
|
||||
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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user