Exceptions
本页列出了使用时可能引发的异常。
The Exception Hierarchy
- ApiException
- ResponseCodeError
- CredentialExpiredError
- SignInvalidError
- CredentialInvalidError
- LoginError
exceptions.api_exception
API Exception
ApiException
ApiException(message: str = '出现了错误,但未说明原因')
Bases: Exception
API Exception 基类
Source code in qqmusic_api/exceptions/api_exception.py
| def __init__(self, message: str = "出现了错误,但未说明原因") -> None:
super().__init__(message)
self.message = message
|
ResponseCodeError
ResponseCodeError(code: int, data: dict, raw: dict, message: str = 'API 返回的响应 code 不符合预期')
Bases: ApiException
API 返回响应的 code 不符合预期
Source code in qqmusic_api/exceptions/api_exception.py
| def __init__(
self,
code: int,
data: dict,
raw: dict,
message: str = "API 返回的响应 code 不符合预期",
) -> None:
self.code = code
self.data = data
self.raw = raw
self.message = message
|
CredentialExpiredError
CredentialExpiredError(data: dict, raw: dict, message: str = '凭证已过期')
Bases: ResponseCodeError
Credential 过期
Source code in qqmusic_api/exceptions/api_exception.py
| def __init__(
self,
data: dict,
raw: dict,
message: str = "凭证已过期",
) -> None:
super().__init__(1000, data, raw, message)
|
CredentialInvalidError
CredentialInvalidError(message: str = '凭证无效')
Bases: ApiException
Credential 无效
Source code in qqmusic_api/exceptions/api_exception.py
| def __init__(self, message: str = "凭证无效") -> None:
super().__init__(message)
|
LoginError
LoginError(message: str = '登录失败')
Bases: ApiException
登录失败
Source code in qqmusic_api/exceptions/api_exception.py
| def __init__(self, message: str = "登录失败") -> None:
super().__init__(message)
|
SignInvalidError
SignInvalidError(data: dict, message: str = '请求签名无效')
Bases: ResponseCodeError
请求签名无效
Source code in qqmusic_api/exceptions/api_exception.py
| def __init__(self, data: dict, message: str = "请求签名无效") -> None:
super().__init__(2000, message=message, data=data, raw={})
|
options:
heading_level: 2