diff --git a/slpkg/blacklist.py b/slpkg/blacklist.py index 5cc5a87c..f39f70d5 100644 --- a/slpkg/blacklist.py +++ b/slpkg/blacklist.py @@ -17,5 +17,9 @@ class Blacklist(Configs): """ Reads the blacklist file. """ file = Path(self.etc_path, 'blacklist.toml') if file.is_file(): - with open(file, 'rb') as black: - return tomli.load(black)['blacklist']['packages'] + try: + with open(file, 'rb') as black: + return tomli.load(black)['blacklist']['packages'] + except tomli.TOMLDecodeError as error: + raise SystemExit(f"\nValueError: {error}: in the configuration file " + "'/etc/slpkg/blacklist.toml'\n")