mirror of
https://github.com/langgenius/dify.git
synced 2026-11-22 19:18:52 +08:00
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
26 lines
859 B
Python
26 lines
859 B
Python
"""Business failures of workflow comment threads; the application service translates them into the slice's errors."""
|
|
|
|
|
|
class WorkflowCommentRuleError(Exception):
|
|
"""A thread rule refused a change; the message states the rule."""
|
|
|
|
|
|
class NotCreatorError(WorkflowCommentRuleError):
|
|
"""The actor did not create the comment or reply it tries to change."""
|
|
|
|
|
|
class InvalidContentError(WorkflowCommentRuleError):
|
|
"""Comment or reply text is blank or too long."""
|
|
|
|
|
|
class InvalidMentionError(WorkflowCommentRuleError):
|
|
def __init__(self, user_id: str) -> None:
|
|
self.user_id = user_id
|
|
super().__init__(f"{user_id} is not a valid uuid.")
|
|
|
|
|
|
class UnknownReplyError(WorkflowCommentRuleError):
|
|
def __init__(self, reply_id: str) -> None:
|
|
self.reply_id = reply_id
|
|
super().__init__(f"The thread has no reply {reply_id}")
|