Skip to content
This repository was archived by the owner on Nov 18, 2025. It is now read-only.

fix: do not fail when decoding unknown error#1077

Merged
gcf-merge-on-green[bot] merged 1 commit intomasterfrom
donotfail
Aug 5, 2021
Merged

fix: do not fail when decoding unknown error#1077
gcf-merge-on-green[bot] merged 1 commit intomasterfrom
donotfail

Conversation

@alexander-fenster
Copy link
Contributor

Fixes googleapis/google-cloud-node-core#361. google-gax has no way to know of all possible error protos, so we'll just skip and ignore those that cannot be decoded.

@alexander-fenster alexander-fenster requested a review from a team as a code owner August 5, 2021 16:35
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Aug 5, 2021
@alexander-fenster alexander-fenster added the automerge Merge the pull request once unit tests and other checks pass. label Aug 5, 2021
const decodedDetail = this.decodeProtobufAny(detail);
details.push(decodedDetail);
} catch (err) {
// cannot decode detail, likely because of the unknown type - just skip it
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any other way we could decode this information? Even if it's not pretty, giving the user some fighting chance to see what's returned, even a stringified object maybe, could be pretty nice.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Users should still get a binary buffer, as before. We'll take a look how we can improve it, but for now let's just put out the fire :)

@gcf-merge-on-green gcf-merge-on-green bot merged commit 90e19b1 into master Aug 5, 2021
@gcf-merge-on-green gcf-merge-on-green bot deleted the donotfail branch August 5, 2021 16:58
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Aug 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error: no such type: google.ads.googleads.v8.errors.GoogleAdsFailure

3 participants