used black
This commit is contained in:
@@ -42,9 +42,9 @@ async def on_error(event: ErrorEvent, bot: Bot):
|
||||
|
||||
await bot.edit_message_caption(
|
||||
inline_message_id=event.update.chosen_inline_result.inline_message_id,
|
||||
caption=f'💔 <b>ERROR</b> occurred. Use this code to get more information: '
|
||||
f'<code>{error_id}</code>',
|
||||
parse_mode='HTML',
|
||||
caption=f"💔 <b>ERROR</b> occurred. Use this code to get more information: "
|
||||
f"<code>{error_id}</code>",
|
||||
parse_mode="HTML",
|
||||
)
|
||||
|
||||
else:
|
||||
@@ -53,7 +53,7 @@ async def on_error(event: ErrorEvent, bot: Bot):
|
||||
exception=pretty_exception,
|
||||
)
|
||||
|
||||
console.print(f'[red]{error_id} occurred[/]')
|
||||
console.print(f"[red]{error_id} occurred[/]")
|
||||
console.print(event)
|
||||
console.print(traceback)
|
||||
console.print(f'-{error_id} occurred-')
|
||||
console.print(f"-{error_id} occurred-")
|
||||
|
||||
@@ -13,12 +13,14 @@ class PrettyException:
|
||||
🐊 <code>{e.__traceback__.tb_frame.f_code.co_filename.replace(os.getcwd(), "")}\r
|
||||
</code>:{e.__traceback__.tb_frame.f_lineno}
|
||||
"""
|
||||
self.short = (f'{e.__class__.__name__}: '
|
||||
f'{"".join(traceback.format_exception_only(e)).strip()}')
|
||||
self.short = (
|
||||
f"{e.__class__.__name__}: "
|
||||
f'{"".join(traceback.format_exception_only(e)).strip()}'
|
||||
)
|
||||
|
||||
self.pretty_exception = (f"{self.long}\n\n"
|
||||
f"⬇️ Trace:"
|
||||
f"{self.get_full_stack()}")
|
||||
self.pretty_exception = (
|
||||
f"{self.long}\n\n" f"⬇️ Trace:" f"{self.get_full_stack()}"
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def get_full_stack():
|
||||
@@ -40,9 +42,11 @@ class PrettyException:
|
||||
|
||||
full_stack = "\n".join(
|
||||
[
|
||||
format_line(line)
|
||||
if re.search(line_regex, line)
|
||||
else f"<code>{line}</code>"
|
||||
(
|
||||
format_line(line)
|
||||
if re.search(line_regex, line)
|
||||
else f"<code>{line}</code>"
|
||||
)
|
||||
for line in full_stack.splitlines()
|
||||
]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user