google-apis-rs / generator

A binding and CLI generator for all google APIs
Apache License 2.0
71 stars 14 forks source link

Better/full error messages from GCP #15

Closed binarybana closed 4 years ago

binarybana commented 4 years ago

It'd be great to get the full error messages from GCP responses. As you can see from the API explorer below with an invalid null value in the request, GCP responds with:

"code": 400, "message": "Invalid value for: null is not a valid value"

(when I was hitting the issue in #14) but the error message I get at the crate API is:

'failed to create bucket: Reqwest(Error(Status(400), "https://www.googleapis.com/storage/v1/b?project=octomizer-dev"))', src/libcore/result.rs:1084:5

https://cloud.google.com/storage/docs/json_api/v1/buckets/insert?apix_params=%7B%22project%22%3A%22octomizer-dev%22%2C%22resource%22%3A%7B%22locationType%22%3Anull%2C%22name%22%3A%22ffd705c0-1e8b-4e8c-aacb-a8dbe1726a775%22%7D%7D

ggriffiniii commented 4 years ago

Good idea. This should be fixed by https://github.com/google-apis-rs/generator/commit/bb915fb5c19f4c98c27f074ba88336b2deabf068