Arag / app /exceptions /access.py
AuthorBot
Restructure project for HF Spaces deployment
772f852
Raw
History Blame Contribute Delete
1.15 kB
"""Author RAG Chatbot SaaS — Access Control Exceptions."""
from app.exceptions.base import AppException
class SubscriptionExpiredError(AppException):
"""Author's subscription has passed its expiry date."""
def __init__(self) -> None:
super().__init__("Subscription has expired")
class AccessRevokedError(AppException):
"""SuperAdmin has explicitly revoked this author's access."""
def __init__(self, reason: str = "Access revoked") -> None:
super().__init__(reason)
self.reason = reason
class BudgetExhaustedError(AppException):
"""Author has used 100% of their monthly token budget."""
def __init__(self) -> None:
super().__init__("Monthly token budget exhausted")
class InvalidSubscriptionTokenError(AppException):
"""Subscription token has invalid HMAC signature — tamper detected."""
def __init__(self) -> None:
super().__init__("Invalid subscription token")
class SubscriptionNotFoundError(AppException):
"""No active subscription record found for this author."""
def __init__(self) -> None:
super().__init__("No active subscription found")