Skip to content

Commit

Permalink
Refactor exception hierarchy under AudibleError. (#550)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkb79 authored Oct 22, 2024
1 parent 65658e6 commit 49a56a3
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/audible/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@
import httpx


class RequestError(Exception):
class AudibleError(Exception):
"""Base class for all errors."""


class RequestError(AudibleError):
"""Base class for all request errors."""


class StatusError(RequestError):
"""Base class for all errors except NotResponding and RatelimitDetectedError."""

Expand Down Expand Up @@ -72,13 +76,13 @@ class UnexpectedError(StatusError):
"""Raised if the error was not caught."""


class AuthFlowError(Exception):
class AuthFlowError(AudibleError):
"""Raised if no auth method available."""


class NoRefreshToken(Exception):
class NoRefreshToken(AudibleError):
"""Raised if refresh token is needed but not provided."""


class FileEncryptionError(Exception):
class FileEncryptionError(AudibleError):
"""Raised if something is wrong with file encryption."""

0 comments on commit 49a56a3

Please sign in to comment.