openmicroscopy/snoopycrimecop — pull request #46 by sbesson (2013-01-14 13:26:50+00:00)
Title: Fail-fast if bad credentials are used

Example from @hflynn who typed her username and a wrong GH password, then used `scc rebase` and got:

``
2013-01-14 10:49:04,092 [ scc.repo] ERROR Failed to find openmicroscopy/ome-documentation
Traceback (most recent call last):
File "/usr/local/bin/scc", line 1383, in
main()
File "/usr/local/bin/scc", line 1378, in main
ns.func(ns)
File "/usr/local/bin/scc", line 1159, in __call__
main_repo = self.gh.git_repo(self.cwd, False)
File "/usr/local/bin/scc", line 228, in git_repo
return GitRepository(self, os.path.abspath(path), *args, **kwargs)
File "/usr/local/bin/scc", line 552, in __init__
self.origin = gh.gh_repo(repo_name, user_name)
File "/usr/local/bin/scc", line 220, in gh_repo
return GitHubRepository(self, username, reponame)
File "/usr/local/bin/scc", line 435, in __init__
self.repo = gh.get_user(user_name).get_repo(repo_name)
File "/Library/Python/2.7/site-packages/github/Github.py", line 60, in get_user
None
File "/Library/Python/2.7/site-packages/github/Requester.py", line 80, in requestAndCheck
raise GithubException.GithubException(status, output)
github.GithubException.GithubException: 401 {u'message': u'Bad credentials'}
[helen@ls27174 ~/ome-documentation]$
``

The check for bad credentials (`get_login()` in `GHManager.autorize`) should be also performed when using username + password. Additionally, the bad credentials error message could be improved.