aboutsummaryrefslogtreecommitdiffstats
path: root/bot/utils/exceptions.py
blob: b4175695556f738f0cfea49de0141ba311d48a96 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from typing import Optional


class UserNotPlayingError(Exception):
    """Raised when users try to use game commands when they are not playing."""

    pass


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

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