aboutsummaryrefslogtreecommitdiffstats
path: root/bot/utils/exceptions.py
blob: b1a35e63632c1d6d039f321a36e3a9ff136d11a9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
class UserNotPlayingError(Exception):
    """Raised when users try to use game commands when they are not playing."""


class APIError(Exception):
    """Raised when an external API (eg. Wikipedia) returns an error response."""

    def __init__(self, api: str, status_code: int, error_msg: str | None = None):
        super().__init__()
        self.api = api
        self.status_code = status_code
        self.error_msg = error_msg


class MovedCommandError(Exception):
    """Raised when a command has moved locations."""

    def __init__(self, new_command_name: str):
        self.new_command_name = new_command_name