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

[Fix #17] redmine resolver deal w/ no issue # #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
7 changes: 6 additions & 1 deletion sphinxcontrib/issuetracker/resolvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ def lookup_jira_issue(app, tracker_config, issue_id):

def lookup_redmine_issue(app, tracker_config, issue_id):
from redmine import Redmine
import redmine.exceptions as redmine_exceptions
if not tracker_config.url:
raise ValueError('URL required')
redmine = Redmine(tracker_config.url,
Expand All @@ -210,7 +211,11 @@ def lookup_redmine_issue(app, tracker_config, issue_id):
password=app.config.issuetracker_redmine_password,
requests=app.config.issuetracker_redmine_requests)
if redmine:
issue = redmine.issue.get(issue_id)
try:
issue = redmine.issue.get(issue_id)
except redmine_exceptions.ResourceNotFoundError:
# requested issue number not found
return None
return Issue(id=issue_id, title=issue.subject,
closed=issue.status is "Closed",
url=issue.url)
Expand Down