SeeMedAI / app /core /errors.py
raihan116's picture
Deploy build 3cef71beb42b-20261019203228
e2be33b verified
Raw History Blame Contribute Delete
678 Bytes
"""Application errors. Each maps to an HTTP status and an error `code` in the API error schema (SRS §5.7)."""
from __future__ import annotations
class AppError(Exception):
code = "internal"
status = 500
class InvalidRequestError(AppError):
code = "invalid_request"
status = 400
class UnauthorizedError(AppError):
code = "unauthorized"
status = 401
class ForbiddenError(AppError):
code = "forbidden"
status = 403
class NotFoundError(AppError):
code = "not_found"
status = 404
class ConflictError(AppError):
code = "conflict"
status = 409
class RateLimitedError(AppError):
code = "rate_limited"
status = 429