redtoad / python-amazon-product-api

A Python wrapper for the Amazon Product Advertising API. This module offers a light-weight access to the latest version of the Amazon Product Advertising API without getting in your way.
https://pypi.org/project/python-amazon-product-api/
BSD 3-Clause "New" or "Revised" License
3 stars 4 forks source link

Missing AWS Error type - AWS.ECommerceService.ItemNotAccessible #55

Open redtoad opened 10 years ago

redtoad commented 10 years ago

Originally reported by Anonymous


The AWS.ECommerceService.ItemNotAccessible error seems to be happening for certain ASIN or ISBN values for many API users. But, it is not handled by the python API. To test it, attempt to do a call like this:

api.item_lookup('192913214X', IdType='ASIN', ResponseGroup="ItemAttributes", SearchIndex="Books", Condition="All") By adding an error type for this, I was able to do a try/except for it. I modified my own local copy to fix it. Here's what I changed to get it working:

errors.py: (inserted at line 16): 'ItemNotAccessible',

errors.py: (inserted at line 174): class ItemNotAccessible(AWSError): """ This item is not accessible through Product Advertising API. """

api.py: (inserted at line 270): 'AWS.ECommerceService.ItemNotAccessible': ItemNotAccessible,


redtoad commented 10 years ago

Original comment by Sebastian Rahlf (Bitbucket: basti, GitHub: basti)


Well spotted! Send me a pull request then I'll include your change.