Skip to content

Commit 13403ff

Browse files
committed
Raise an error if no elligible pets
1 parent b0ab319 commit 13403ff

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

main.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,7 @@ def pick_pet(pets):
110110
# Check pet has an image, adoption url, and has not been posted
111111
eligible = [pet for pet in pets if pet.image_url and pet.adoption_url and pet.pet_id not in posted_pet_ids]
112112
if not eligible:
113-
sys.exit("Error: No elligible pets found.")
114-
return None
113+
raise ValueError("No elligible pet found")
115114

116115
selected_pet = random.choice(eligible)
117116
# Add pet ID to list of posted pets

0 commit comments

Comments
 (0)