[docs]classHTTPError(AnmokuException):__slots__=("status","type","message","report_url",)def__init__(self,resp:ErrorResponseDict):self.status:int=resp["status"]self.type:str=resp["type"]self.message:str=resp["message"]self.report_url:Optional[str]=resp.get("report_url")# TODO: error trace?msg=f"{self.type} (status code {self.status}): {self.message}"ifself.report_urlisnotNone:msg+=f"\nYou can report this issue to the Jikan GitHub via this link: {self.report_url}"super().__init__(msg)
[docs]classResourceNotSupportedError(AnmokuException):def__init__(self,resource:Type[JikanResource],not_supported:str,logger:Logger=None):super().__init__(f"The '{resource.__name__}' resource does not support {not_supported}!",logger)