Refine exception handling

This commit is contained in:
thePR0M3TH3AN
2025-08-05 20:34:26 -04:00
parent ade2d99572
commit 87cf2d837b
4 changed files with 74 additions and 5 deletions

View File

@@ -13,6 +13,7 @@ import signal
import time
import argparse
import tomli
from tomli import TOMLDecodeError
from colorama import init as colorama_init
from termcolor import colored
from utils.color_scheme import color_text
@@ -46,7 +47,7 @@ def load_global_config() -> dict:
try:
with open(config_path, "rb") as f:
return tomli.load(f)
except Exception as exc:
except (OSError, TOMLDecodeError) as exc:
logging.warning(f"Failed to read {config_path}: {exc}")
return {}