Skip to content

Commit

Permalink
update exceptions.py
Browse files Browse the repository at this point in the history
  • Loading branch information
freddy36 committed Dec 27, 2023
1 parent 0a0dad5 commit 7768bac
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions audiobookdl/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,23 @@ class UserNotAuthorized(AudiobookDLException):
class MissingBookAccess(AudiobookDLException):
error_description = "book_access"

class BookNotFound(AudiobookDLException):
error_description = "book_not_found"

class BookNotReleased(AudiobookDLException):
error_description = "book_not_released"

class BookHasNoAudiobook(AudiobookDLException):
error_description = "book_has_no_audiobook"

class ConfigNotFound(AudiobookDLException):
error_description = "config_not_found"

class GenericAudiobookDLException(AudiobookDLException):
error_description: str = "generic"

def __init__(self, heading: str, body: str = None) -> None:
self.data = {'heading': heading, 'body': body if body else ""}

class DownloadError(AudiobookDLException):
error_description: str = "download_error"

0 comments on commit 7768bac

Please sign in to comment.