google / fuzzbench

FuzzBench - Fuzzer benchmarking as a service.

Home Page:https://google.github.io/fuzzbench/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cloud Config: Improve error message for deleting an experiment that doesn't exist.

mvanotti opened this issue · comments

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 <module>
    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.

Good point!
Would you like to create a PR to include the error message that you desire?

We would really appreciate that.