Skip to content

Commit

Permalink
fix: clean up grpc error handling and integration test for promote er…
Browse files Browse the repository at this point in the history
…ror info field (#1110)

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`. Moved`caller.ts` to import GoogleErrorDecode, and handle the metadata key.
3. Add a [test](https://github.com/googleapis/gax-nodejs/pull/1110/files#diff-c147f17fee3db816a973dc2a49fe46717e6f0c1b29fe069c56cb4606a7862d57R209) for situation of `GoogleAdsFailure`. It also sent it in gRPC metadata. In gax, we still decode details ignore the `GoogleAdsFailure`.
  • Loading branch information
summer-ji-eng authored Oct 1, 2021
1 parent 23be1cc commit 966b596
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 966b596

Please sign in to comment.