abhinavk99 / jikanpy

Python wrapper for the Jikan API
MIT License
217 stars 29 forks source link

Except - Try in Jikanpy #97

Closed ghost closed 3 years ago

ghost commented 3 years ago

Hello author. I was trying to implementation except-try code when using jikanpy

here the concept :

 search_result = jikan.search('anime', "qqqqqqqqqq",parameters={'limit': 10})
  try: 
  # if 200
  except HTTPError:
 #if 404
  print("Can't find this title,please check")

But is not working. It just give this log. I want to show the line ("Can't find this title,please check") when running the app. Log:

 line 78, in _wrap_response
    raise APIException(response.status_code, json_response, **kwargs)
jikanpy.exceptions.APIException: HTTP 404 - status=404, type=BadResponseException, message=Resource does not exist, error=404 on https://myanimelist.net/anime.php?q=&type=0&score=0&status=0&p=0&r=0&sd=0&sm=0&sy=0&ed=0&em=0&ey=0&gx=0&c[]=a&c[]=b&c[]=c&c[]=f&c[]=d&c[]=e&c[]=g for search type=anime, query=
purarue commented 3 years ago

closing this as troubleshooting on discord instead