Print box around message for unexpected exceptions

This commit is contained in:
Joscha 2021-05-31 11:50:20 +02:00
parent 1dd24551a5
commit 17879a7f69

View File

@ -8,6 +8,7 @@ from typing import AsyncIterator, ContextManager, Iterator, List, Optional
from rich.console import Console, RenderGroup from rich.console import Console, RenderGroup
from rich.live import Live from rich.live import Live
from rich.markup import escape from rich.markup import escape
from rich.panel import Panel
from rich.progress import (BarColumn, DownloadColumn, Progress, TaskID, TextColumn, TimeRemainingColumn, from rich.progress import (BarColumn, DownloadColumn, Progress, TaskID, TextColumn, TimeRemainingColumn,
TransferSpeedColumn) TransferSpeedColumn)
from rich.table import Column from rich.table import Column
@ -170,10 +171,13 @@ class Log:
self.error_contd("") self.error_contd("")
self.error_contd(traceback.format_exc()) self.error_contd(traceback.format_exc())
self.error_contd(""" # Our print function doesn't take types other than strings, but the
# underlying rich.print function does. This call is a special case
# anyways, and we're calling it internally, so this should be fine.
self.print(Panel.fit("""
Please copy your program output and send it to the PFERD maintainers, either Please copy your program output and send it to the PFERD maintainers, either
directly or as a GitHub issue: https://github.com/Garmelon/PFERD/issues/new directly or as a GitHub issue: https://github.com/Garmelon/PFERD/issues/new
""".strip()) """.strip())) # type: ignore
def explain_topic(self, text: str) -> None: def explain_topic(self, text: str) -> None:
""" """