akaszynski/keepa

KeyError: 'NEW'

KTACQU opened this issue · 3 comments

Error is returned on occasion and not sure why? Sometimes runs smoothly - cant pinpoint issue other than server failure? Is there a fix for this?

price = products[i]['data']['NEW']
KeyError: 'NEW'

I suspect this happens because Keepa does not have any data concerning new condition prices for this product.
A fix would be to use:
price = products[i]['data'].get('NEW', list())

Hmmm, solution worked, but issue can arise at any moment, even directly after a successful pull of NEW prices

Ill close this issue, I guess for future fixes -- something to reference