Skip to content

Commit 2b5ce1a

Browse files
committed
fix: add url not found catching
1 parent 7f41d24 commit 2b5ce1a

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

augur/tasks/github/events.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from augur.tasks.init.celery_app import celery_app as celery
88
from augur.tasks.init.celery_app import AugurCoreRepoCollectionTask
99
from augur.application.db.data_parse import *
10-
from augur.tasks.github.util.github_data_access import GithubDataAccess
10+
from augur.tasks.github.util.github_data_access import GithubDataAccess, UrlNotFoundException
1111
from augur.tasks.github.util.github_random_key_auth import GithubRandomKeyAuth
1212
from augur.tasks.github.util.util import get_owner_repo
1313
from augur.tasks.util.worker_util import remove_duplicate_dicts
@@ -280,17 +280,20 @@ def _collect_and_process_issue_events(self, owner, repo, repo_id, key_auth):
280280

281281
event_url = f"https://api.github.com/repos/{owner}/{repo}/issues/{issue_number}/events"
282282

283-
for event in github_data_access.paginate_resource(event_url):
283+
try:
284+
for event in github_data_access.paginate_resource(event_url):
284285

285-
event, contributor = self._process_github_event_contributors(event)
286+
event, contributor = self._process_github_event_contributors(event)
286287

287-
if contributor:
288-
contributors.append(contributor)
288+
if contributor:
289+
contributors.append(contributor)
289290

290-
events.append(
291-
extract_issue_event_data(event, issue["issue_id"], platform_id, repo_id,
292-
self._tool_source, self._tool_version, self._data_source)
293-
)
291+
events.append(
292+
extract_issue_event_data(event, issue["issue_id"], platform_id, repo_id,
293+
self._tool_source, self._tool_version, self._data_source)
294+
)
295+
except UrlNotFoundException as e:
296+
self._logger.warning(f"{self.repo_identifier}: Url not found for {event_url}")
294297

295298
if len(events) > 500:
296299
self._insert_contributors(contributors)

0 commit comments

Comments
 (0)