-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathcommittee_actions.py
More file actions
38 lines (25 loc) · 1.05 KB
/
committee_actions.py
File metadata and controls
38 lines (25 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
"""Custom exception classes for committee-action tracking."""
from typing import TYPE_CHECKING, override
from typed_classproperties import classproperty
from .base import BaseTeXBotError
if TYPE_CHECKING:
from collections.abc import Sequence
__all__: "Sequence[str]" = ("InvalidActionDescriptionError", "InvalidActionTargetError")
class InvalidActionTargetError(BaseTeXBotError, RuntimeError):
"""
Exception class to raise when the desired target of a committee action is invalid.
This could be that the target user is not in the server.
"""
@classproperty
@override
def DEFAULT_MESSAGE(cls) -> str:
return "The target of the action is invalid."
class InvalidActionDescriptionError(BaseTeXBotError, RuntimeError):
"""
Exception class to raise when the description of a committee action is invalid.
This could be due to it being too long, or some other validation issue.
"""
@classproperty
@override
def DEFAULT_MESSAGE(cls) -> str:
return "The description of the action is invalid."