maimai_py.exceptions

 1from typing import Type
 2
 3from maimai_ffi.exceptions import AimeServerError, ArcadeIdentifierError, TitleServerBlockedError, TitleServerNetworkError
 4
 5AimeServerError: Type[Exception]
 6ArcadeIdentifierError: Type[Exception]
 7TitleServerBlockedError: Type[Exception]
 8TitleServerNetworkError: Type[Exception]
 9
10
11class MaimaiPyError(Exception):
12    """Base exception class for all exceptions raised by maimai_py."""
13
14
15class InvalidJsonError(MaimaiPyError):
16    """Invalid JSON response from the provider."""
17
18
19class InvalidPlayerIdentifierError(MaimaiPyError):
20    """Player identifier is invalid for the provider.
21
22    For example, friend code is not applicable for Diving Fish provider, the username is not applicable for LXNS provider.
23
24    Also, if the player is not found on that provider, this exception will be raised.
25    """
26
27
28class InvalidDeveloperTokenError(MaimaiPyError):
29    """Developer token is not provided or token is invalid."""
30
31
32class InvalidPlateError(MaimaiPyError):
33    """Provided version or plate is invalid.
34
35    Plate should be formatted as two/three characters (version + kind), e.g. "桃将", "舞舞舞"
36
37    The following versions are valid:
38
39    霸, 舞, 初, 真, 超, 檄, 橙, 晓, 桃, 樱, 紫, 堇, 白, 雪, 辉, 熊, 华, 爽, 煌, 星, 宙, 祭, 祝, 双, 宴.
40
41    The following kinds are valid:
42
43    将, 者, 極, 极, 舞舞, 神
44
45    """
46
47
48class PrivacyLimitationError(MaimaiPyError):
49    """The user has not accepted the privacy policy or exceeded the privacy limit of the provider."""
50
51
52class InvalidWechatTokenError(MaimaiPyError):
53    """Wahlap Wechat OffiAccount token is invalid or expired."""
54
55
56WechatTokenExpiredError = InvalidWechatTokenError
class AimeServerError(maimai_ffi.exceptions.ArcadeError):

Common base class for all non-exit exceptions.

class ArcadeIdentifierError(maimai_ffi.exceptions.ArcadeError):

Common base class for all non-exit exceptions.

class TitleServerBlockedError(maimai_ffi.exceptions.TitleServerError):

Common base class for all non-exit exceptions.

class TitleServerNetworkError(maimai_ffi.exceptions.TitleServerError):

Common base class for all non-exit exceptions.

class MaimaiPyError(builtins.Exception):
12class MaimaiPyError(Exception):
13    """Base exception class for all exceptions raised by maimai_py."""

Base exception class for all exceptions raised by maimai_py.

class InvalidJsonError(MaimaiPyError):
16class InvalidJsonError(MaimaiPyError):
17    """Invalid JSON response from the provider."""

Invalid JSON response from the provider.

class InvalidPlayerIdentifierError(MaimaiPyError):
20class InvalidPlayerIdentifierError(MaimaiPyError):
21    """Player identifier is invalid for the provider.
22
23    For example, friend code is not applicable for Diving Fish provider, the username is not applicable for LXNS provider.
24
25    Also, if the player is not found on that provider, this exception will be raised.
26    """

Player identifier is invalid for the provider.

For example, friend code is not applicable for Diving Fish provider, the username is not applicable for LXNS provider.

Also, if the player is not found on that provider, this exception will be raised.

class InvalidDeveloperTokenError(MaimaiPyError):
29class InvalidDeveloperTokenError(MaimaiPyError):
30    """Developer token is not provided or token is invalid."""

Developer token is not provided or token is invalid.

class InvalidPlateError(MaimaiPyError):
33class InvalidPlateError(MaimaiPyError):
34    """Provided version or plate is invalid.
35
36    Plate should be formatted as two/three characters (version + kind), e.g. "桃将", "舞舞舞"
37
38    The following versions are valid:
39
40    霸, 舞, 初, 真, 超, 檄, 橙, 晓, 桃, 樱, 紫, 堇, 白, 雪, 辉, 熊, 华, 爽, 煌, 星, 宙, 祭, 祝, 双, 宴.
41
42    The following kinds are valid:
43
44    将, 者, 極, 极, 舞舞, 神
45
46    """

Provided version or plate is invalid.

Plate should be formatted as two/three characters (version + kind), e.g. "桃将", "舞舞舞"

The following versions are valid:

霸, 舞, 初, 真, 超, 檄, 橙, 晓, 桃, 樱, 紫, 堇, 白, 雪, 辉, 熊, 华, 爽, 煌, 星, 宙, 祭, 祝, 双, 宴.

The following kinds are valid:

将, 者, 極, 极, 舞舞, 神

class PrivacyLimitationError(MaimaiPyError):
49class PrivacyLimitationError(MaimaiPyError):
50    """The user has not accepted the privacy policy or exceeded the privacy limit of the provider."""

The user has not accepted the privacy policy or exceeded the privacy limit of the provider.

class InvalidWechatTokenError(MaimaiPyError):
53class InvalidWechatTokenError(MaimaiPyError):
54    """Wahlap Wechat OffiAccount token is invalid or expired."""

Wahlap Wechat OffiAccount token is invalid or expired.

WechatTokenExpiredError = <class 'InvalidWechatTokenError'>