Skip to content

Commit

Permalink
fix: catch error that occurs when ghost usre creates an event.
Browse files Browse the repository at this point in the history
Signed-off-by: Zack Koppert <[email protected]>
  • Loading branch information
zkoppert committed Jun 24, 2024
1 parent 0958b56 commit 1affdcf
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions time_to_ready_for_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,14 @@ def get_time_to_ready_for_review(
return None

events = issue.issue.events(number=50)
for event in events:
if event.event == "ready_for_review":
return event.created_at
try:
for event in events:
if event.event == "ready_for_review":
return event.created_at
except TypeError as e:
print(
f"An error occurred processing review events. Perhaps issue contains a ghost user. {e}"
)
return None

return None

0 comments on commit 1affdcf

Please sign in to comment.