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

warn user if they hadn't changed API key #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nshadov
Copy link

@nshadov nshadov commented Aug 10, 2017

Display more understandable/trackable error message about missing API key:

...
File "./vtlite.py", line 15, in __init__
    assert "KEY-GOES-HERE" not in your_public_api_key
AssertionError

Copy link

@justNik101 justNik101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just include it in try except block (enhance it) like -
try:
your_private_api_key = '<--------------PRIVATE-API-KEY-GOES-HERE----->'
assert "KEY-GOES-HERE" not in your_private_api_key
except AssertionError:
print("Oops! it looks like you forgot to add your API key!")

@nshadov nshadov force-pushed the master branch 5 times, most recently from 8044af1 to 2617ad5 Compare October 9, 2017 19:04
@justNik101
Copy link

Great, it can be more better, add one more condition to check if Api variable has same length as Api keys and it is in hexadecimal format

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

Successfully merging this pull request may close these issues.

2 participants