# tenant_manager/tenant_exceptions.py
 
from fastapi.responses import JSONResponse
 
 
class TenantError(Exception):
    status = 400
    message = "Tenant Error"
 
    def to_response(self):
        return JSONResponse(
            status_code=self.status,
            content={"error": self.message}
        )
 
 
class TenantNotFound(TenantError):
    status = 404
    message = "Tenant does not exist"
 
 
class UserNotFound(TenantError):
    status = 404
    message = "User does not exist under tenant"
 
 
class InvalidToken(TenantError):
    status = 401
    message = "Invalid or missing JWT token"
 
 
class CollectionNotFound(TenantError):
    status = 404
    message = "Qdrant collection does not exist"
 
   
 