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

crash on HTTP 401 error #11

Open
ktdreyer opened this issue Dec 10, 2015 · 0 comments
Open

crash on HTTP 401 error #11

ktdreyer opened this issue Dec 10, 2015 · 0 comments

Comments

@ktdreyer
Copy link
Member

chacractl binary create <endpoint> <binaryfile> prints a stack trace if I have the wrong key in my ~/.chacractl:

Traceback (most recent call last):
  File "venv/bin/chacractl", line 6, in <module>
    main.ChacraCtl()
  File "venv/local/lib/python2.7/site-packages/chacractl/main.py", line 37, in __init__
    self.main(argv)
  File "venv/local/lib/python2.7/site-packages/chacractl/decorators.py", line 68, in newfunc
    return f(*a, **kw)
  File "venv/local/lib/python2.7/site-packages/chacractl/main.py", line 80, in main
    parser.dispatch()
  File "venv/local/lib/python2.7/site-packages/tambo/dispatcher.py", line 21, in dispatch
    return instance.main()
  File "venv/local/lib/python2.7/site-packages/chacractl/api/binaries.py", line 123, in main
    self.post(url, filename)
  File "venv/local/lib/python2.7/site-packages/chacractl/api/binaries.py", line 80, in post
    response.raise_for_status()
  File "venv/local/lib/python2.7/site-packages/requests/models.py", line 837, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://chacra.example.com/binaries/myproject/myref/ubuntu/trusty/source/

It's probably better to catch the HTTPError and print an explanation to the user about what could have gone wrong.

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