openmicroscopy/snoopycrimecop — pull request #96 by sbesson (2013-09-17 09:05:24+00:00)
Title: Rebase nopr

From @aleksandra-tarkowska, if PR does not exist `scc rebase` fails with a huge stack trace

```
macbookpro:openmicroscopy ola$ scc rebase 11413 develop
# github.token and github.user not found.
# See `/usr/local/bin/scc token` for simpifying use.
Username or token: aleksandra-tarkowska
Enter password for http://github.com/aleksandra-tarkowska:
Traceback (most recent call last):
File "/usr/local/bin/scc", line 8, in
load_entry_point('scc==0.3.8', 'console_scripts', 'scc')()
File "/Library/Python/2.7/site-packages/scc.py", line 2405, in entry_point
main()
File "/Library/Python/2.7/site-packages/scc.py", line 2396, in main
ns.func(ns)
File "/Library/Python/2.7/site-packages/scc.py", line 1817, in __call__
self.rebase(args, main_repo)
File "/Library/Python/2.7/site-packages/scc.py", line 1834, in rebase
pr = main_repo.origin.get_pull(args.PR)
File "/Library/Python/2.7/site-packages/github/Repository.py", line 1344, in get_pull
None
File "/Library/Python/2.7/site-packages/github/Requester.py", line 95, in requestJsonAndCheck
return self.__check(*self.requestJson(verb, url, parameters, input))
File "/Library/Python/2.7/site-packages/github/Requester.py", line 103, in __check
raise self.__createException(status, output)
github.GithubException.UnknownObjectException: 404 {u'documentation_url': u'http://developer.github.com/v3', u'message': u'Not Found'}
macbookpro:openmicroscopy ola$
```

This PR improves this exception by wrapping the `get_pull()` call and improves the readability or the error message
```
sebastien@sbesson:scc (rebase_nopr) $ python scc.py rebase 0 develop
Cannot find pull request 0
```

Also check the additional unit test in `test/TestRebase.py` passes the Travis build.