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

Catch exception if travis isn't set up #77

Closed
gforsyth opened this issue Aug 18, 2016 · 1 comment
Closed

Catch exception if travis isn't set up #77

gforsyth opened this issue Aug 18, 2016 · 1 comment
Milestone

Comments

@gforsyth
Copy link
Member

Just caught this when I tried to regenerate the deploy key without first enabling travis

Key generation went fine but then requests barfed when it couldn't talk to travis

Traceback (most recent call last):
  File "/home/gil/anaconda/bin/doctr", line 9, in <module>
    load_entry_point('doctr==1.1.1+42.g9c5359b', 'console_scripts', 'doctr')()
  File "/home/gil/anaconda/lib/python3.5/site-packages/doctr-1.1.1+42.g9c5359b-py3.5.egg/doctr/__main__.py", line 210, in main
    return process_args(get_parser())
  File "/home/gil/anaconda/lib/python3.5/site-packages/doctr-1.1.1+42.g9c5359b-py3.5.egg/doctr/__main__.py", line 96, in process_args
    return args.func(args, parser)
  File "/home/gil/anaconda/lib/python3.5/site-packages/doctr-1.1.1+42.g9c5359b-py3.5.egg/doctr/__main__.py", line 153, in configure
    encrypted_variable = encrypt_variable(b"DOCTR_DEPLOY_ENCRYPTION_KEY=" + key, build_repo=build_repo)
  File "/home/gil/anaconda/lib/python3.5/site-packages/doctr-1.1.1+42.g9c5359b-py3.5.egg/doctr/local.py", line 45, in encrypt_variable
    r.raise_for_status()
  File "/home/gil/anaconda/lib/python3.5/site-packages/requests/models.py", line 837, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.travis-ci.org/repos/drdoctr/doctr/key

We can just catch this exception and gently remind the user to go to travis and enable the repository

@asmeurer asmeurer added this to the 1.2 milestone Aug 18, 2016
@asmeurer
Copy link
Member

It will also give this error if the repo doesn't exist, so we should check that too (ideally before generating the ssh key).

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

2 participants