[docs]classConfigKeyError(Exception):"""Raised when config key is not found. Args: key (str | List[str]): Missing config key """def__init__(self,key:str|List[str])->None:self.key:str|List[str]=keysuper().__init__(f"Config key {'.'.join(key)ifisinstance(key,list)elsekey} is missing. Please set in your config file.")def__str__(self):returnf"Config key {'.'.join(self.key)ifisinstance(self.key,list)elseself.key} is missing. Please set in your config file."
[docs]classConfigValueError(Exception):"""Raised when config key's value is invalid. Args: key (str | List[str]): Invalid config key value (Optional[Any]): Key's correct value """def__init__(self,key:str|List[str],value:Optional[Any]=None)->None:self.key:str|List[str]=keyself.value:Optional[Any]=valuesuper().__init__(f"Config key {'.'.join(key)ifisinstance(key,list)elsekey} has invalid value. {f'Must be {value}. 'ifvalueelse''}Please set in your config file.")def__str__(self):returnf"Config key {'.'.join(self.key)ifisinstance(self.key,list)elseself.key} has invalid value. {f'Must be {self.value}. 'ifself.valueelse''}Please set in your config file."