zmoog/refurbished

Exception: Ooops, it looks like your store doesn't carry those products: mac when using wrong store name

danieltomasz opened this issue ยท 1 comments

Really nice library! I just found it!
If I wrongly specify store (be instead of be-fr of be-nl) I am getting the error

Traceback (most recent call last):
  File "/home/daniel/.pyenv/versions/3.8.7/bin/rfrb", line 61, in <module>
    get_products(auto_envvar_prefix='REFURBISHED')
  File "/home/daniel/.pyenv/versions/3.8.7/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/daniel/.pyenv/versions/3.8.7/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/daniel/.pyenv/versions/3.8.7/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/daniel/.pyenv/versions/3.8.7/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/daniel/.pyenv/versions/3.8.7/bin/rfrb", line 47, in get_products
    for p in search_products(
  File "/home/daniel/.pyenv/versions/3.8.7/lib/python3.8/site-packages/refurbished/__init__.py", line 40, in get_macs
    return self._get_products('mac', **kwargs)
  File "/home/daniel/.pyenv/versions/3.8.7/lib/python3.8/site-packages/refurbished/__init__.py", line 85, in _get_products
    raise Exception(f'Ooops, it looks like your store doesn\'t carry those products: {product_family}')
Exception: Ooops, it looks like your store doesn't carry those products: mac

It should rather inform the user that given store doesn't exist checking the list of available stores

zmoog commented

Hey @danieltomasz, I am sorry for missing this issue, back in the day when you opened it I probably wasn't paying attention to GitHub notificato so I end up reading it today.. ๐Ÿ˜ž

I don't know if this is still relevant to you, but this specific issue is now fixed:

$ python cli/rfrb be macs 
Product 'macs' is not available in the 'be' store