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

Make it easier to trouble-shoot a failure to connect to bitbucket #10

Merged
merged 1 commit into from
Aug 25, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,14 @@ def get_comments(issue):
issues = []
while True:
url = "https://api.bitbucket.org/1.0/repositories/%s/%s/issues/?start=%d" % (options.bitbucket_username, options.bitbucket_repo, options.start-1) #-1 because the start option is id-1
response = urllib2.urlopen(url)
try:
response = urllib2.urlopen(url)
except urllib2.HTTPError as ex:
raise ValueError(
'Problem trying to connect to bitbucket ({url}): {ex} '
'Hint: the bitbucket repository name is case-sensitive.'
.format(url=url, ex=ex))

result = json.loads(response.read())
if not result['issues']:
# Check to see if there is issues to process if not break out.
Expand Down