Skip to content

Commit

Permalink
Handle ParserError when parsing dates
Browse files Browse the repository at this point in the history
Signed-off-by: Keshav Priyadarshi <[email protected]>
  • Loading branch information
keshav-space committed Mar 26, 2024
1 parent 531e8db commit 38c65fa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/fetchcode/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import os
import requests
from dateutil import parser as dateparser
from dateutil.parser import ParserError


def fetch_github_tags_gql(purl):
Expand All @@ -34,7 +35,10 @@ def fetch_github_tags_gql(purl):
committed_date = target.get("committedDate")
release_date = None
if committed_date:
release_date = dateparser.parse(committed_date)
try:
release_date = dateparser.parse(committed_date)
except ParserError as e:
pass

yield name, release_date

Expand Down

0 comments on commit 38c65fa

Please sign in to comment.