Files
dify/api/services/app/workflow_comment_errors.py
-LAN-andautofix-ci[bot] aa11e7a73a refactor(api): pilot an aggregate for workflow comments (#44307)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-11-16 07:30:40 +00:00

34 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.")