Skip to content

Exceptions

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) -> None:
        self.message = 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) -> None:
        self.message = 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
class ResponseError(Exception):
    """Raised when an API response is empty or has an unexpected format"""

    def __init__(self, message) -> None:
        self.message = "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) -> None:
        self.message = 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) -> None:
        self.message = message