-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathstrike.py
More file actions
40 lines (27 loc) · 1.26 KB
/
strike.py
File metadata and controls
40 lines (27 loc) · 1.26 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
39
40
"""Custom exception classes raised when errors occur during use of the "/strike" command."""
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]" = ("NoAuditLogsStrikeTrackingError", "StrikeTrackingError")
class StrikeTrackingError(BaseTeXBotError, RuntimeError):
"""
Exception class to raise when any error occurs while tracking moderation actions.
If this error occurs, it is likely that manually applied moderation actions will be missed
and not tracked correctly.
"""
@classproperty
@override
def DEFAULT_MESSAGE(cls) -> str:
return "An error occurred while trying to track manually applied moderation actions."
class NoAuditLogsStrikeTrackingError(BaseTeXBotError, RuntimeError):
"""
Exception class to raise when there are no audit logs to resolve the committee member.
If this error occurs, it is likely that manually applied moderation actions will be missed
and not tracked correctly.
"""
@classproperty
@override
def DEFAULT_MESSAGE(cls) -> str:
return "Unable to retrieve audit log entry after possible manual moderation action."