lquerel / gcp-bigquery-client

GCP BigQuery Client (Rust)
Apache License 2.0
92 stars 60 forks source link

job: get_job: expansion of error flow #13

Closed nixxholas closed 2 years ago

nixxholas commented 2 years ago

This PR focuses more on expanding the code flow of get_job. Yes, it makes the code "bloated", but an example below makes it so much easier for a developer to create useful BPs that allow him/her/them to get to the root of the problem. Screenshot 2021-11-10 at 11 39 06 AM

lquerel commented 2 years ago

Thanks @nixxholas.

lquerel commented 2 years ago

I fixed another similar issue (i.e. request_builder) in the cancel_job endpoint.

However, I have reverted the changes to the error handling. I don't see the real advantage of replacing the question mark operator ? with a series of if. This is not idiomatic and most error variants contain the origin of the error which makes it possible to display a backtrace via a crate like color-eyre for debugging purposes.