add storage foundation contracts
This commit is contained in:
parent
0ca0bac9bf
commit
5381c997e2
6 changed files with 208 additions and 0 deletions
|
|
@ -1,3 +1,6 @@
|
|||
from uuid import UUID
|
||||
|
||||
|
||||
class DomainError(Exception):
|
||||
pass
|
||||
|
||||
|
|
@ -18,6 +21,48 @@ class UserConflictError(UserError):
|
|||
self.email = email
|
||||
|
||||
|
||||
class WorkspaceError(DomainError):
|
||||
pass
|
||||
|
||||
|
||||
class WorkspaceNotFoundError(WorkspaceError):
|
||||
def __init__(self, workspace_id: UUID) -> None:
|
||||
super().__init__('workspace_not_found')
|
||||
self.workspace_id = workspace_id
|
||||
|
||||
|
||||
class WorkspaceQuotaExceededError(WorkspaceError):
|
||||
def __init__(self, workspace_id: UUID) -> None:
|
||||
super().__init__('workspace_quota_exceeded')
|
||||
self.workspace_id = workspace_id
|
||||
|
||||
|
||||
class ChatError(DomainError):
|
||||
pass
|
||||
|
||||
|
||||
class ChatNotFoundError(ChatError):
|
||||
def __init__(self, chat_id: UUID) -> None:
|
||||
super().__init__('chat_not_found')
|
||||
self.chat_id = chat_id
|
||||
|
||||
|
||||
class ChatHasActiveSandboxError(ChatError):
|
||||
def __init__(self, chat_id: UUID) -> None:
|
||||
super().__init__('chat_has_active_sandbox')
|
||||
self.chat_id = chat_id
|
||||
|
||||
|
||||
class ChatFileError(DomainError):
|
||||
pass
|
||||
|
||||
|
||||
class ChatFileNotFoundError(ChatFileError):
|
||||
def __init__(self, file_id: UUID) -> None:
|
||||
super().__init__('chat_file_not_found')
|
||||
self.file_id = file_id
|
||||
|
||||
|
||||
class SandboxError(DomainError):
|
||||
pass
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue