Skip to content

Commit ad4c2da

Browse files
committed
Improved exception handling
1 parent 252d421 commit ad4c2da

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ Get the ASIN from a URL:
5353

5454
Changelog
5555
-------------
56+
Version 2.0.1
57+
- Improved exception handling.
58+
5659
Version 2.0.0
5760
- New structure for product info, adding all available information from the API.
5861
- Added raw_data with the information unparsed from the API.

amazon/paapi.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,6 @@ def parse_product(item):
443443
except Exception:
444444
product.prices.other.offer_id = None
445445

446-
447446
# Offers Summary
448447
try:
449448
summaries = item.offers.summaries
@@ -623,9 +622,8 @@ class instance: An instance of the class Product containing all the available
623622
condition=condition,
624623
item_ids=asin_list,
625624
resources=product_resources)
626-
except ValueError as exception:
627-
logging.error('Error in forming GetItemsRequest: %s' % (exception))
628-
return
625+
except Exception as exception:
626+
raise exception
629627

630628
try:
631629
# Wait before doing the request
@@ -651,5 +649,4 @@ class instance: An instance of the class Product containing all the available
651649
return None
652650

653651
except Exception as exception:
654-
logging.error(str(exception))
655-
return None
652+
raise exception

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name='python-amazon-paapi',
8-
version='2.0.0',
8+
version='2.0.1',
99
author='Sergio Abad',
1010
author_email='sergio.abad@bytelix.com',
1111
description='Amazon Product Advertising API 5.0 wrapper for Python',

0 commit comments

Comments
 (0)