summaryrefslogtreecommitdiff
path: root/inverter-bot
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2021-05-23 00:16:48 +0300
committerEvgeny Zinoviev <me@ch1p.io>2021-05-23 00:16:48 +0300
commitb37fb3673577af86b00b40b90b3c1a6117dec529 (patch)
tree6aa007751b7707ffc4fc934d6b8220c1815c38b0 /inverter-bot
parentc23be0f78d4003c860967d379540e2f463992b75 (diff)
fix handle_exc
Diffstat (limited to 'inverter-bot')
-rwxr-xr-xinverter-bot5
1 files changed, 4 insertions, 1 deletions
diff --git a/inverter-bot b/inverter-bot
index 6f8c40b..fc6fccc 100755
--- a/inverter-bot
+++ b/inverter-bot
@@ -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):