Issue #22 resolved

Error Handling

Oliver Wilkie
created an issue

Hi, I'm trying to use the api for my django-powered website.

The relevant code is attached here

{{{

!python

from amazonproduct import API
api = API(AWS_KEY, SECRET_KEY, 'us') node = api.item_search('Music', Artist=artist, ResponseGroup='Images') try: total_pages = node.Items.TotalPages.pyval except NoExactMatchesFound: total_pages = 0 }}}

I am getting this error from django

Exception Type: TemplateSyntaxError Exception Value:

Caught an exception while rendering: global name 'NoExactMatchesFound' is not defined

Any ideas?

Comments (4)

  1. Anonymous

    You didn't import NoExactMatchesFound

    Use from amazonproduct import * as documented, or from amazonproduct import NoExactMatchesFound

  2. Log in to comment