mirror of
https://github.com/Benexl/FastAnime.git
synced 2026-01-27 07:14:33 -08:00
feat: custom exception handling
This commit is contained in:
16
fastanime/cli/utils/exceptions.py
Normal file
16
fastanime/cli/utils/exceptions.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import sys
|
||||
|
||||
|
||||
def custom_exception_hook(exc_type, exc_value, exc_traceback):
|
||||
print(f"{exc_type.__name__}: {exc_value}")
|
||||
|
||||
|
||||
default_exception_hook = sys.excepthook
|
||||
# sys.tracebacklimit = 0
|
||||
|
||||
|
||||
def setup_exceptions_handler(trace: bool | None, dev: bool | None):
|
||||
if trace or dev:
|
||||
sys.excepthook = default_exception_hook
|
||||
else:
|
||||
sys.excepthook = custom_exception_hook
|
||||
Reference in New Issue
Block a user