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

nbdistribute --template fail gracefully #15

Closed
betatim opened this issue Dec 4, 2018 · 1 comment
Closed

nbdistribute --template fail gracefully #15

betatim opened this issue Dec 4, 2018 · 1 comment

Comments

@betatim
Copy link
Collaborator

betatim commented Dec 4, 2018

Have nbdistribute --template fail gracefully when the repo already exists.

@lwasser
Copy link

lwasser commented Dec 5, 2018

Currently when the repo exists, you get this message:

(earth-analytics-python) MacBook-Pro-4:autograded-course-starter leah-su$ nbdistribute --template
Using /Users/leah-su/Documents/github/2-autograding/autograded-course-starter/student to create the student template.
Loading configuration from config.yml
Creating template repository.
Traceback (most recent call last):
  File "/Users/leah-su/anaconda3/envs/earth-analytics-python/bin/nbdistribute", line 11, in <module>
    sys.exit(distribute())
  File "/Users/leah-su/anaconda3/envs/earth-analytics-python/lib/python3.6/site-packages/grading/__main__.py", line 131, in distribute
    config['github']['token'])
  File "/Users/leah-su/anaconda3/envs/earth-analytics-python/lib/python3.6/site-packages/grading/github.py", line 55, in create_repo
    organization.create_repository(repository, title)
  File "/Users/leah-su/anaconda3/envs/earth-analytics-python/lib/python3.6/site-packages/github3/decorators.py", line 30, in auth_wrapper
    return func(self, *args, **kwargs)
  File "/Users/leah-su/anaconda3/envs/earth-analytics-python/lib/python3.6/site-packages/github3/orgs.py", line 630, in create_repository
    json = self._json(self._post(url, data), 201)
  File "/Users/leah-su/anaconda3/envs/earth-analytics-python/lib/python3.6/site-packages/github3/models.py", line 156, in _json
    raise exceptions.error_for(response)
github3.exceptions.UnprocessableEntity: 422 Repository creation failed.

it would be nice for it to leave a nice little message like
"i already did that dumb@ss" :) or something even nicer?!

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