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

jipsearch: catching jira exceptions #72

Merged
merged 5 commits into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion jipdate/jipcreate.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def parse_issue_file(new_issue_file):
def initialize_logger(args):
LOG_FMT = "[%(levelname)s] %(funcName)s():%(lineno)d %(message)s"
lvl = log.ERROR
if args.v:
if args.verbose:
lvl = log.DEBUG

log.basicConfig(
Expand Down
2 changes: 1 addition & 1 deletion jipdate/jipdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ def get_editor():
def initialize_logger(args):
LOG_FMT = "[%(levelname)s] %(funcName)s():%(lineno)d %(message)s"
lvl = log.ERROR
if args.v:
if args.verbose:
lvl = log.DEBUG

log.basicConfig(
Expand Down
21 changes: 13 additions & 8 deletions jipdate/jipsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import sys
import yaml
from dateutil import parser
from jira import JIRAError

# Local files
from jipdate import cfg
Expand Down Expand Up @@ -205,7 +206,7 @@ def get_parser():
def initialize_logger(args):
LOG_FMT = "[%(levelname)s] %(funcName)s():%(lineno)d %(message)s"
lvl = log.ERROR
if args.v:
if args.verbose:
lvl = log.DEBUG

log.basicConfig(
Expand Down Expand Up @@ -299,13 +300,17 @@ def search_issues(jira, jql):
if cfg.args.parent:
fields.append("parent")

result = jira.search_issues(
jql,
startAt=result["startAt"],
maxResults=max_results,
fields=fields,
json_result=True,
)
try:
result = jira.search_issues(
jql,
startAt=result["startAt"],
maxResults=max_results,
fields=fields,
json_result=True,
)
except JIRAError as e:
print(f"{e.text}")
exit(1)
issues += result["issues"]
result["startAt"] += max_results

Expand Down
2 changes: 1 addition & 1 deletion jipdate/jipstatus.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def get_parser():
def initialize_logger(args):
LOG_FMT = "[%(levelname)s] %(funcName)s():%(lineno)d %(message)s"
lvl = log.ERROR
if args.v:
if args.verbose:
lvl = log.DEBUG

log.basicConfig(
Expand Down