Skip to content

Commit

Permalink
Improve Bugzilla access denied message
Browse files Browse the repository at this point in the history
  • Loading branch information
tysmith committed May 27, 2024
1 parent 0816053 commit 4294587
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions grizzly/common/bugzilla.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ def load(cls, bug_id: int) -> Optional["BugzillaBug"]:
return cls(bugzilla.get(bug_id))
except BugsyException as exc:
LOG.error("%s", exc.msg)
# Access Denied
if api_key is None and exc.code == 102:
LOG.info(
"Set BZ_API_KEY in your environment or download the testcase "
"manually to run with grizzly.replay."
)
except RequestsConnectionError as exc:
LOG.error("Unable to connect to %r (%s)", bugzilla.bugzilla_url, exc)
return None
Expand Down
1 change: 1 addition & 0 deletions grizzly/common/test_bugzilla.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def test_bugzilla_01(mocker):
"exc",
[
BugsyException("foo", error_code=101),
BugsyException("access denied", error_code=102),
RequestsConnectionError(),
],
)
Expand Down

0 comments on commit 4294587

Please sign in to comment.