diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2021-05-23 01:09:27 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2021-05-23 01:09:27 +0300 |
commit | ebbcded71eaa7203f79326354249fb640853e447 (patch) | |
tree | f646cda44e5a6ef8f2e97c79e8e57f5eb028c2a6 | |
parent | b37fb3673577af86b00b40b90b3c1a6117dec529 (diff) |
handle_exc: update error output format
-rwxr-xr-x | inverter-bot | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/inverter-bot b/inverter-bot index fc6fccc..547d5a0 100755 --- a/inverter-bot +++ b/inverter-bot @@ -88,7 +88,8 @@ def handle_exc(update: Update, e) -> None: err = json.loads(str(e))['message'] except json.decoder.JSONDecodeError: err = str(e) - reply(update, f'<b>Error:</b> {err}') + err = re.sub(r'((?:.*)?error:) (.*)', r'<b>\1</b> \2', err) + reply(update, err) elif not isinstance(e, TimedOut): reply(update, 'exception: ' + str(e)) |