mirror of
https://github.com/langgenius/dify.git
synced 2026-11-24 20:59:04 +08:00
33 lines
1012 B
Python
33 lines
1012 B
Python
"""Application errors of Console workflow comments, raised by the service and its adapters."""
|
|||
|
|
|
||
|
|
|
||
|
|
class WorkflowCommentError(Exception):
|
||
|
|
"""Base class for framework-neutral workflow comment failures."""
|
||
|
|
|
||
|
|
|
||
|
|
class WorkflowCommentAppNotFoundError(WorkflowCommentError):
|
||
|
|
def __init__(self) -> None:
|
||
|
|
super().__init__("App not found")
|
||
|
|
|
||
|
|
|
||
|
|
class WorkflowCommentNotFoundError(WorkflowCommentError):
|
||
|
|
def __init__(self) -> None:
|
||
|
|
super().__init__("Comment not found")
|
||
|
|
|
||
|
|
|
||
|
|
class WorkflowCommentReplyNotFoundError(WorkflowCommentError):
|
||
|
|
def __init__(self) -> None:
|
||
|
|
super().__init__("Reply not found")
|
||
|
|
|
||
|
|
|
||
|
|
class WorkflowCommentPermissionError(WorkflowCommentError):
|
||
|
|
"""Raised when an account edits or deletes a comment or reply it did not create."""
|
||
|
|
|
||
|
|
|
||
|
|
class InvalidWorkflowCommentContentError(WorkflowCommentError):
|
||
|
|
pass
|
||
|
|
|
||
|
|
|
||
|
|
class InvalidMentionedUserIdError(WorkflowCommentError):
|
||
|
|
def __init__(self, user_id: str) -> None:
|
||
|
|
super().__init__(f"{user_id} is not a valid uuid.")
|