mirror of
https://gitlab.com/simple-stock-bots/simple-telegram-stock-bot.git
synced 2025-06-16 15:06:53 +00:00
#56 added message when errors occur.
This commit is contained in:
parent
15a62b7989
commit
e6ebd81928
19
bot.py
19
bot.py
@ -466,14 +466,17 @@ def error(update: Update, context: CallbackContext):
|
||||
)
|
||||
tb_string = "".join(tb_list)
|
||||
print(tb_string)
|
||||
if update:
|
||||
message = (
|
||||
f"An exception was raised while handling an update\n"
|
||||
f"<pre>update = {html.escape(json.dumps(update.to_dict(), indent=2, ensure_ascii=False))}"
|
||||
"</pre>\n\n"
|
||||
f"<pre>context.chat_data = {html.escape(str(context.chat_data))}</pre>\n\n"
|
||||
f"<pre>context.user_data = {html.escape(str(context.user_data))}</pre>\n\n"
|
||||
f"<pre>{html.escape(tb_string)}</pre>"
|
||||
# if update:
|
||||
# message = (
|
||||
# f"An exception was raised while handling an update\n"
|
||||
# f"<pre>update = {html.escape(json.dumps(update.to_dict(), indent=2, ensure_ascii=False))}"
|
||||
# "</pre>\n\n"
|
||||
# f"<pre>context.chat_data = {html.escape(str(context.chat_data))}</pre>\n\n"
|
||||
# f"<pre>context.user_data = {html.escape(str(context.user_data))}</pre>\n\n"
|
||||
# f"<pre>{html.escape(tb_string)}</pre>"
|
||||
# )
|
||||
update.message.reply_text(
|
||||
text="An error has occured. Please inform @MisterBiggs if the error persists."
|
||||
)
|
||||
|
||||
# Finally, send the message
|
||||
|
Loading…
x
Reference in New Issue
Block a user