Skip to content

Exceptions

Classes:

Name Description
ClientError

Raised when the API returns a 4xx status code

InternalServerError

Raised when the API returns a 5xx status code

ResponseError

Raised when an API response is empty or has an unexpected format

RetryLimitExceeded

Raised when the retry limit is exceeded

TooManyRequests

Raised when the API returns a 429 status code

ClientError

Bases: Exception

Raised when the API returns a 4xx status code

Source code in pyflowery/exceptions.py
class ClientError(Exception):
    """Raised when the API returns a 4xx status code"""

    def __init__(self, message: str) -> None:
        super().__init__(self)
        self.message: str = message

InternalServerError

Bases: Exception

Raised when the API returns a 5xx status code

Source code in pyflowery/exceptions.py
class InternalServerError(Exception):
    """Raised when the API returns a 5xx status code"""

    def __init__(self, message: str) -> None:
        super().__init__(self)
        self.message: str = message

ResponseError

Bases: Exception

Raised when an API response is empty or has an unexpected format

Source code in pyflowery/exceptions.py
1
2
3
4
5
6
class ResponseError(Exception):
    """Raised when an API response is empty or has an unexpected format"""

    def __init__(self, message: str) -> None:
        super().__init__(self)
        self.message: str = "Invalid response from Flowery API: " + message

RetryLimitExceeded

Bases: Exception

Raised when the retry limit is exceeded

Source code in pyflowery/exceptions.py
class RetryLimitExceeded(Exception):
    """Raised when the retry limit is exceeded"""

    def __init__(self, message: str) -> None:
        super().__init__(self)
        self.message: str = message

TooManyRequests

Bases: Exception

Raised when the API returns a 429 status code

Source code in pyflowery/exceptions.py
class TooManyRequests(Exception):
    """Raised when the API returns a 429 status code"""

    def __init__(self, message: str) -> None:
        super().__init__(self)
        self.message: str = message