commit 7ece99560bbf651a4b77e740ccc1bb6affd659c6
parent 62219df14b158c2f84a045cb8dbd727a2a3ac0b5
Author: Andrew Halberstadt <ahal@mozilla.com>
Date: Wed, 22 Oct 2025 18:22:23 +0000
Bug 1990567 - [ci] Catch TaskclusterRestFailure in target_tasks.py, r=taskgraph-reviewers,bhearsum
Differential Revision: https://phabricator.services.mozilla.com/D269606
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/taskcluster/gecko_taskgraph/target_tasks.py b/taskcluster/gecko_taskgraph/target_tasks.py
@@ -11,6 +11,7 @@ from datetime import datetime, timedelta
import requests
from redo import retry
+from taskcluster.exceptions import TaskclusterRestFailure
from taskgraph import create
from taskgraph.target_tasks import filter_for_git_branch, register_target_task
from taskgraph.util.attributes import attrmatch
@@ -77,7 +78,9 @@ def index_exists(index_path, reason=""):
task_id = find_task_id(index_path)
print(f"Index {index_path} exists: taskId {task_id}")
return True
- except KeyError:
+ except (KeyError, TaskclusterRestFailure) as e:
+ if isinstance(e, TaskclusterRestFailure) and e.status_code != 404:
+ raise
print(f"Index {index_path} doesn't exist.")
return False