Fail safely when no issues can be found
Note that it's a bare except... not so nice
This commit is contained in:
@@ -140,13 +140,16 @@ def list_issues(gitserver, options):
|
||||
"""
|
||||
Lists all issues for options['issues']
|
||||
"""
|
||||
for issue in gitserver.projects.get(options['issues']).issues.list(all=True):
|
||||
if issue.state != 'opened' and not options['closed']:
|
||||
continue
|
||||
if 'finding' in issue.labels:
|
||||
add_finding(issue, options)
|
||||
if 'non-finding' in issue.labels:
|
||||
add_non_finding(issue, options)
|
||||
try:
|
||||
for issue in gitserver.projects.get(options['issues']).issues.list(all=True):
|
||||
if issue.state != 'opened' and not options['closed']:
|
||||
continue
|
||||
if 'finding' in issue.labels:
|
||||
add_finding(issue, options)
|
||||
if 'non-finding' in issue.labels:
|
||||
add_non_finding(issue, options)
|
||||
except:
|
||||
print_error('could not find any issues', -1)
|
||||
|
||||
|
||||
def list_projects(gitserver, options):
|
||||
|
||||
Reference in New Issue
Block a user