Files
-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

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}")