Skip to content

Commit

Permalink
Fix KeyError with user query result (#368)
Browse files Browse the repository at this point in the history
The return object could be dictionary when failed auth, which could
cause the KeyError exception. Fix it by also catch the KeyError.

Signed-off-by: Wayne Sun <[email protected]>
  • Loading branch information
waynesun09 committed Aug 29, 2024
1 parent 017887f commit c068154
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion did/plugins/gitlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def get_user(self, username):
) from jde
try:
return result[0]
except IndexError:
except (IndexError, KeyError):
raise ReportError(
"Unable to find user '{0}' on GitLab.".format(username))

Expand Down

0 comments on commit c068154

Please sign in to comment.