mirror of
https://github.com/Garmelon/PFERD.git
synced 2026-04-13 07:55:05 +02:00
Move FatalException to errors.py
This commit is contained in:
parent
19c1e3ac6f
commit
f6faacabb0
5 changed files with 13 additions and 11 deletions
|
|
@ -7,12 +7,18 @@ from typing import Any, Callable
|
|||
|
||||
from rich.console import Console
|
||||
|
||||
from .logging import FatalException, PrettyLogger
|
||||
from .logging import PrettyLogger
|
||||
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
PRETTY = PrettyLogger(LOGGER)
|
||||
|
||||
|
||||
class FatalException(Exception):
|
||||
"""
|
||||
A fatal exception occurred. Recovery is not possible.
|
||||
"""
|
||||
|
||||
|
||||
def swallow_and_print_errors(function: Callable) -> Callable:
|
||||
"""
|
||||
Decorates a function, swallows all errors, logs them and returns none if one occurred.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue