Skip to content

Commit

Permalink
Add PlistError class for first run functionality error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
liquidz00 committed Jun 27, 2024
1 parent af1c492 commit 5cca38e
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""

Expand Down Expand Up @@ -222,7 +238,8 @@ def error_handling(log: LogMe, stop_event: Event):
DeviceOSFetchError,
SortError,
SofaFeedError,
APIPrivilegeError
APIPrivilegeError,
PlistError
)
try:
yield
Expand Down

0 comments on commit 5cca38e

Please # to comment.