handle_exc: update error output format

This commit is contained in:
Evgeny Zinoviev 2021-05-23 01:09:27 +03:00
parent b37fb36735
commit ebbcded71e

View File

@ -88,7 +88,8 @@ def handle_exc(update: Update, e) -> None:
err = json.loads(str(e))['message'] err = json.loads(str(e))['message']
except json.decoder.JSONDecodeError: except json.decoder.JSONDecodeError:
err = str(e) 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): elif not isinstance(e, TimedOut):
reply(update, 'exception: ' + str(e)) reply(update, 'exception: ' + str(e))