PyFlowery/pyflowery/exceptions.py

20 lines
616 B
Python
Raw Normal View History

class InternalServerError(Exception):
2024-09-17 23:31:50 -04:00
"""Raised when the API returns a 5xx status code"""
def __init__(self, message):
self.message = message
class ClientError(Exception):
2024-09-17 23:31:50 -04:00
"""Raised when the API returns a 4xx status code"""
def __init__(self, message):
self.message = message
class TooManyRequests(Exception):
2024-09-17 23:31:50 -04:00
"""Raised when the API returns a 429 status code"""
def __init__(self, message):
self.message = message
class RetryLimitExceeded(Exception):
2024-09-17 23:31:50 -04:00
"""Raised when the retry limit is exceeded"""
def __init__(self, message):
self.message = message