diff --git a/src/utils/ConfigReader.py b/src/utils/ConfigReader.py index e9c0805..99e5659 100644 --- a/src/utils/ConfigReader.py +++ b/src/utils/ConfigReader.py @@ -52,13 +52,13 @@ class ConfigReader: with open(self.__config_path, 'r', encoding='utf-8') as file: self.__config_data = json.load(file) except FileNotFoundError as e: - raise Exception(f"Config file not found: {self.__config_path}") from e + raise Exception(f"配置文件不存在: {self.__config_path}") from e except PermissionError as e: - raise Exception(f"Without enough permission to read config file: {self.__config_path}") from e + raise Exception(f"没有足够的权限读取配置文件: {self.__config_path}") from e except json.JSONDecodeError as e: - raise Exception(f"JSON decode error in config file: {self.__config_path}") from e + raise Exception(f"JSON 解析错误: {self.__config_path}") from e except Exception as e: - raise Exception(f"Unknown error occurred while reading config file: {e}") from e + raise Exception(f"读取配置文件时未知错误: {e}") from e def getConfigs( diff --git a/src/utils/ConfigWriter.py b/src/utils/ConfigWriter.py index 5373c56..a7092df 100644 --- a/src/utils/ConfigWriter.py +++ b/src/utils/ConfigWriter.py @@ -58,13 +58,13 @@ class ConfigWriter: with open(self.__config_path, "w", encoding="utf-8") as f: json.dump(self.__config_data, f, indent=4, sort_keys=False) except PermissionError as e: - raise Exception(f"Without enough permission to write config file: {self.__config_path}") from e + raise Exception(f"没有足够的权限写入配置文件: {self.__config_path}") from e except IOError as e: - raise Exception(f"IO error occurred while writing config file: {self.__config_path}") from e + raise Exception(f"写入配置文件时发生 IO 错误: {self.__config_path}") from e except TypeError as e: - raise Exception(f"Config data contains invalid type that can not be JSON serialized: {e}") from e + raise Exception(f"配置数据包含无法 JSON 序列化的类型: {e}") from e except Exception as e: - raise Exception(f"Unknown error occurred while writing config file: {e}") from e + raise Exception(f"写入配置文件时未知错误: {e}") from e def setConfigs(