Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: clean up grpc error handling and integration test for promote error info field #1110

Merged
merged 17 commits into from Oct 1, 2021

Conversation

summer-ji-eng
Copy link
Contributor

@summer-ji-eng summer-ji-eng commented Sep 20, 2021

Clean up googleError class

Changes:

  1. Add errorInfoMetadata placeholder for errorInfo.metadata, same as errorInfo.reason, errorInfo.domain. Replace previously add error info metadata key-value pair into the existing metadata.
    Reasons:

    • Because metadata occupied for gRPC metadata, we have to rename for ErrorInfo's metadata.
    • If add the key value in existing metadata, it is still hard for user figure out the which keys are from gRPC metadata, which keys are from ErrorInfo.
  2. Wrapped the decoding in GoogleError.parseGRPCStatusDetails. Movedcaller.ts to import GoogleErrorDecode, and handle the metadata key.

  3. Add a test for situation of GoogleAdsFailure. It also sent it in gRPC metadata. In gax, we still decode details ignore the GoogleAdsFailure.

@summer-ji-eng summer-ji-eng requested a review from a team as a code owner September 20, 2021 07:00
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Sep 20, 2021
@summer-ji-eng summer-ji-eng changed the title fix: clean up grpc error handling and integeration test for promote error info field fix: clean up grpc error handling and integration test for promote error info field Sep 22, 2021
Copy link
Member

@alexander-fenster alexander-fenster left a comment

Choose a reason for hiding this comment

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

LGTM but please don't release this until you verified that Ads libraries work. We can make a pre-release and ask Ads folks to check it.

@summer-ji-eng summer-ji-eng added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Sep 22, 2021
@summer-ji-eng
Copy link
Contributor Author

Checked with Ads team. It works as expected.

@summer-ji-eng summer-ji-eng added automerge Merge the pull request once unit tests and other checks pass. and removed do not merge Indicates a pull request not ready for merge, due to either quality or timing. labels Oct 1, 2021
@gcf-merge-on-green gcf-merge-on-green bot merged commit 966b596 into main Oct 1, 2021
@gcf-merge-on-green gcf-merge-on-green bot deleted the grpc_error branch October 1, 2021 17:38
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Oct 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants