diff --git a/src/exceptions.py b/src/exceptions.py index 2f77db5..723458f 100644 --- a/src/exceptions.py +++ b/src/exceptions.py @@ -63,6 +63,22 @@ def __str__(self): return self.message +class PlistError(PatcherError): + """Raised when there is an error creating directories.""" + + def __init__(self, message="Unable to interact with plist!", path=None): + self.path = path + if path: + message = f"{message} - Path: {path}" + super().__init__(message) + self.message = message + + def __str__(self): + if self.path: + return f"{self.message} - Path: {self.path}" + return self.message + + class ExportError(PatcherError): """Raised when encountering error(s) exporting data to files.""" @@ -222,7 +238,8 @@ def error_handling(log: LogMe, stop_event: Event): DeviceOSFetchError, SortError, SofaFeedError, - APIPrivilegeError + APIPrivilegeError, + PlistError ) try: yield