fix(pubsublite): remove publish error translation #3843
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The original intention of translating pubsublite internal errors to equivalent pubsub errors, was so that mostly the same code can be used to publish. I'd like to backtrack on this implementation decision - it wasn't explicitly discussed at any point.
The errors returned by pubsublite are wrapped to provide more useful context (e.g. the
ErrOversizedMessage
error includes the proto size of the user's message), so we should just propagate errors to users as-is.The publisher clients of pubsublite and pubsub have sufficient differences in behavior, such that users will have to handle publish errors differently anyway. For example, pubsublite's PublisherClient can terminate permanently (while pubsub's Topic doesn't) and users have to create a new instance to republish failed messages.
pubsublite has a superset of pubsub errors. We will soon have an additional
ErrServiceUnavailable
error to indicate prolonged backend service unavailability.