Skip to content

Commit f8f52c5

Browse files
committed
Let's not stop the script for a single invalid input
1 parent 1a1ba14 commit f8f52c5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/models/europython.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def extract_twitter_url(text: str) -> str:
9191
return twitter_url.split("?")[0]
9292

9393
@staticmethod
94-
def extract_mastodon_url(text: str) -> str:
94+
def extract_mastodon_url(text: str) -> None | str:
9595
"""
9696
Normalize Mastodon handle or URL to the format: https://<instance>/@<username>
9797
"""
@@ -105,7 +105,7 @@ def extract_mastodon_url(text: str) -> str:
105105
elif len(parts) == 2: # username@instance
106106
username, instance = parts
107107
else:
108-
raise ValueError("Invalid Mastodon handle format")
108+
return None
109109
return f"https://{instance}/@{username}"
110110

111111
# Handle full URLs

0 commit comments

Comments
 (0)