Skip to content

Commit

Permalink
Raise JIRAError when no user found (#1383)
Browse files Browse the repository at this point in the history
raise error if no user found
  • Loading branch information
lishoujun committed Jul 26, 2022
1 parent c8945f3 commit 313ba9a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions jira/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1803,6 +1803,9 @@ def _get_user_id(self, user: Optional[str]) -> Optional[str]:
else:
users = self.search_users(user=user, maxResults=20)

if len(users) < 1:
raise JIRAError(f"No matching user found for: '{user}'")

matches = []
if len(users) > 1:
matches = [u for u in users if self._get_user_identifier(u) == user]
Expand Down

0 comments on commit 313ba9a

Please sign in to comment.