google-cloud-rust icon indicating copy to clipboard operation
google-cloud-rust copied to clipboard

[auth] Slightly better error message

Open stepancheg opened this issue 9 months ago • 1 comments
trafficstars

I wrote very simple code:

            google_cloud_storage::client::ClientConfig::default()
                .with_auth()
                .await
                .unwrap();

and error message is not helpful:

called `Result::unwrap()` on an `Err` value: HttpError(reqwest::Error { kind: Decode, source: Error("missing field `access_token`", line: 6, column: 1) })

at least add what server we are talking to the error message to help a bit with reverse engineering what it is trying to do:

called `Result::unwrap()` on an `Err` value: HttpError("https://oauth2.googleapis.com/token", reqwest::Error { kind: Decode, source: Error("missing field `access_token`", line: 6, column: 1) })

stepancheg avatar Feb 05 '25 00:02 stepancheg