Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pyWinCalc: Fix error message when there is no valid API key for the igsdb #32

Open
RDmitchell opened this issue Nov 22, 2022 · 1 comment

Comments

@RDmitchell
Copy link
Contributor

From Christian
Mon, Nov 21, 1:26 PM


Stephen,

I can run PyWinCalc on my Mac, but we should fix this error message:
python3 igsdb_double_clear_glass.py
Traceback (most recent call last):
File "igsdb_double_clear_glass.py", line 31, in
generic_clear_3mm_glass = pywincalc.parse_json(generic_clear_3mm_glass_igsdb_response.content)
RuntimeError: Unable to parse json. It does not appear to be either of the two recognized formats. Currently only IGSDB v1 and v2 formats are supported.

You get this message if you haven't put an IGSDB API key in igsdb_interaction.py.
There is nothing in the README about this on GitHub. We should at least have a decent error message that suggests that maybe you don't have your API key set (print "Your API Key"+igsdb_api_token)

@RDmitchell
Copy link
Contributor Author

From Stephen
Mon, Nov 21, 2:07 PM


Interacting with the IGSDB is not part of pywincalc's current functionality. pywincalc does not know anything about urls or managing API keys.

You are getting that error message because you have asked pywincalc to try to convert a string that is probably something similar to "403 Forbidden" into product data. Which it cannot do. But it also cannot convert "404 Not Found" or "503 Service Unavailable" or the contents of other random strings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant