aboutsummaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/__init__.py14
-rw-r--r--src/utils/errors.py12
2 files changed, 14 insertions, 12 deletions
diff --git a/src/utils/__init__.py b/src/utils/__init__.py
index 294b9083..71e46b82 100644
--- a/src/utils/__init__.py
+++ b/src/utils/__init__.py
@@ -5,6 +5,8 @@ from . import cli, consts, datetime, decorators, irc, http, parse, security
from .decorators import export, hook, kwarg
from .settings import (BoolSetting, FunctionSetting, IntRangeSetting,
IntSetting, OptionsSetting, sensitive_format, SensitiveSetting, Setting)
+from .errors import (EventError, EventsNotEnoughArgsError, EventResultsError,
+ EventUsageError)
class Direction(enum.Enum):
Send = 0
@@ -13,18 +15,6 @@ class Direction(enum.Enum):
def prevent_highlight(nickname: str) -> str:
return nickname[0]+"\u200c"+nickname[1:]
-class EventError(Exception):
- pass
-class EventsResultsError(EventError):
- def __init__(self):
- EventError.__init__(self, "Failed to load results")
-class EventsNotEnoughArgsError(EventError):
- def __init__(self, n):
- EventError.__init__(self, "Not enough arguments (minimum %d)" % n)
-class EventsUsageError(EventError):
- def __init__(self, usage):
- EventError.__init__(self, "Not enough arguments, usage: %s" % usage)
-
class MultiCheck(object):
def __init__(self,
requests: typing.List[typing.Tuple[str, typing.List[str]]]):
diff --git a/src/utils/errors.py b/src/utils/errors.py
new file mode 100644
index 00000000..7b7720c6
--- /dev/null
+++ b/src/utils/errors.py
@@ -0,0 +1,12 @@
+class EventError(Exception):
+ pass
+class EventResultsError(EventError):
+ def __init__(self):
+ EventError.__init__(self, "Failed to load results")
+class EventNotEnoughArgsError(EventError):
+ def __init__(self, n):
+ EventError.__init__(self, "Not enough arguments (minimum %d)" % n)
+class EventUsageError(EventError):
+ def __init__(self, usage):
+ EventError.__init__(self, "Not enough arguments, usage: %s" % usage)
+