Cloud Config: Improve error message for deleting an experiment that doesn't exist.
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 302
- PR merge metrics
- No merged PRs in 30d
Description
Today I tried to delete an experiment twice, and the error message returned by `stop_experiment.py` was not really clear:
```
DEBUG:googleapiclient.discovery:URL being requested: GET https://compute.googleapis.com/compute/v1/projects/google.com%3Amyproject/zones/us-central1-a/instances?alt=json
DEBUG:google_auth_httplib2:Making request: POST https://oauth2.googleapis.com/token
Traceback (most recent call last):
File "/data/fuzzbench/experiment/stop_experiment.py", line 77, in
sys.exit(main())
File "/data/fuzzbench/experiment/stop_experiment.py", line 73, in main
return 0 if stop_experiment(sys.argv[1], sys.argv[2]) else 1
File "/data/fuzzbench/experiment/stop_experiment.py", line 40, in stop_experiment
instances = list(gce.get_instances(cloud_project, cloud_compute_zone))
File "/data/fuzzbench/common/gce.py", line 47, in get_instances
for instance in _get_instance_items(project, zone):
File "/data/fuzzbench/common/gce.py", line 39, in _get_instance_items
for instance in response['items']:
KeyError: 'items'
```
It would be nice if the script displays a better error message for the user.
Contributor guide
Assessment
This issue has not been assessed yet.