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

refactor(pubsublite): add context to error messages for leaf services #3649

Merged
merged 4 commits into from
Feb 4, 2021

Conversation

tmdiep
Copy link
Contributor

@tmdiep tmdiep commented Feb 2, 2021

Publisher and subscriber clients consist of a tree of services, where the leaf services wrap gRPC streams. When errors are propagated to the top-level publisher/subscriber clients, the context may be ambiguous (e.g. RPC errors) and not helpful for debugging.

This PR wraps errors in the leaf services, e.g. publisher(/projects/project-id/locations/zone/topics/topic-id/partitions/1): %w. golang.org/x/xerrors is used because error wrapping/unwrapping is supported from Go 1.13 onwards. Once we drop support for 1.11, we can just use the standard library.

@tmdiep tmdiep requested a review from hongalex February 2, 2021 04:21
@tmdiep tmdiep requested review from a team as code owners February 2, 2021 04:21
@product-auto-label product-auto-label bot added the api: pubsublite Issues related to the Pub/Sub Lite API. label Feb 2, 2021
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsublite Issues related to the Pub/Sub Lite API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants