Files
leleka/scripts/e2e/codex/tasks/crm/reference/overlay/errors.py
T

22 lines
629 B
Python

"""Exceptions shared by the CRM layers; each maps to an HTTP status."""
class ValidationError(ValueError):
"""Raised when client input cannot be accepted (HTTP 400)."""
class NotFoundError(Exception):
"""Raised when a record or route does not exist (HTTP 404)."""
class MethodNotAllowedError(Exception):
"""Raised when a route exists but not for this method (HTTP 405)."""
def __init__(self, allowed=()):
super().__init__("method not allowed")
self.allowed = tuple(allowed)
class PayloadTooLargeError(Exception):
"""Raised when a request body exceeds the accepted size (HTTP 413)."""