Spaces:
Sleeping
Sleeping
File size: 757 Bytes
0aee47a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
"""
bilibili_api.exceptions.ResponseCodeException
API 返回 code 错误。
"""
from .ApiException import ApiException
class ResponseCodeException(ApiException):
"""
API 返回 code 错误。
"""
def __init__(self, code: int, msg: str, raw: dict = None):
"""
Args:
code (int): 错误代码。
msg (str): 错误信息。
raw (dict, optional): 原始响应数据. Defaults to None.
"""
super().__init__(msg)
self.msg = msg
self.code = code
self.raw = raw
def __str__(self):
return f"接口返回错误代码:{self.code},信息:{self.msg}。\n{self.raw}"
|