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

Handle TokenNotSet Error more gracefully #76

Open
ivyleavedtoadflax opened this issue Aug 11, 2023 · 2 comments
Open

Handle TokenNotSet Error more gracefully #76

ivyleavedtoadflax opened this issue Aug 11, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@ivyleavedtoadflax
Copy link
Contributor

Currently we get the following traceback:

Traceback (most recent call last):
  File "/home/matthew/.local/bin/hugie", line 5, in <module>
    from hugie.__main__ import app
  File "/home/matthew/.local/pipx/venvs/hugie/lib/python3.10/site-packages/hugie/__main__.py", line 7, in <module>
    from hugie.endpoint import app as endpoint_app
  File "/home/matthew/.local/pipx/venvs/hugie/lib/python3.10/site-packages/hugie/endpoint.py", line 27, in <module>
    raise TokenNotSet
hugie.endpoint.TokenNotSet: You need to define a token using the environment variable HUGGINGFACE_READ_TOKEN

Let's catch this and just print to console instead in a more friendly way.

@nsorros
Copy link
Contributor

nsorros commented Aug 11, 2023

What would be the desirable output? Now showing the traceback?

@nsorros nsorros added the enhancement New feature or request label Aug 11, 2023
@ivyleavedtoadflax
Copy link
Contributor Author

Yeah i think so, something a bit less scary looking

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

No branches or pull requests

2 participants