Closed Bug 1401183 Opened 2 years ago Closed 2 years ago

Return KeyError from list_artifacts when none is found

Categories

(Firefox Build System :: Task Configuration, task)

task
Not set

Tracking

(Not tracked)

RESOLVED FIXED
mozilla57

People

(Reporter: dustin, Assigned: dustin)

Details

Attachments

(1 file)

Instead of a requests error that might also be transient.
Comment on attachment 8909767 [details]
Bug 1401183: raise KeyError from list_artifacts when none is found;

https://reviewboard.mozilla.org/r/181264/#review187000

::: commit-message-e4261:1
(Diff revision 1)
> +Bug 1401183: return KeyError from list_artifacts when none is found; r?glandium

s/return/raise/

::: taskcluster/taskgraph/util/taskcluster.py:90
(Diff revision 1)
>  def find_task_id(index_path, use_proxy=False):
> +    try:
> -    response = _do_request(get_index_url(index_path, use_proxy))
> +        response = _do_request(get_index_url(index_path, use_proxy))
> +    except requests.exceptions.HTTPError as e:
> +        if e.response.status_code == 404:
> +            raise KeyError

you should raise an instance, not the class.
Attachment #8909767 - Flags: review?(mh+mozilla) → review+
Pushed by dmitchell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/83fdd1638d8e
raise KeyError from list_artifacts when none is found; r=glandium
https://hg.mozilla.org/mozilla-central/rev/83fdd1638d8e
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
Product: TaskCluster → Firefox Build System
You need to log in before you can comment on or make changes to this bug.