Skip to content

fix(pubsub)!: return PublishError from Publish instead of an Arc<gax::error>#4681

Merged
suzmue merged 2 commits intogoogleapis:mainfrom
PhongChuong:pubsubError
Feb 13, 2026
Merged

fix(pubsub)!: return PublishError from Publish instead of an Arc<gax::error>#4681
suzmue merged 2 commits intogoogleapis:mainfrom
PhongChuong:pubsubError

Conversation

@PhongChuong
Copy link
Copy Markdown
Collaborator

@PhongChuong PhongChuong commented Feb 13, 2026

Switch Publisher Publish to return PublishError instead of Arc.

For SendError, the application can inspect the source of the send error. The source is wrapped in Arc as an error in a Batch send can cause multiple Publish errors.

The tests are also updated to check for the new error type.

For #4650

@PhongChuong PhongChuong marked this pull request as ready for review February 13, 2026 20:55
@PhongChuong PhongChuong requested a review from a team as a code owner February 13, 2026 20:55
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.01%. Comparing base (35df47c) to head (1be4c96).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4681      +/-   ##
==========================================
- Coverage   95.02%   95.01%   -0.01%     
==========================================
  Files         196      196              
  Lines        7551     7547       -4     
==========================================
- Hits         7175     7171       -4     
  Misses        376      376              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Collaborator

@suzmue suzmue left a comment

Choose a reason for hiding this comment

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

PR Title nit: reword to finish the sentence "This change modifies the crate to ...". For example "return a PublishError from publish instead of a Arcgax::error"

PR description nit: no colon needed after "For"

source,
Some(crate::error::PublishError::OrderingKeyPaused(()))
),
matches!(got_err, crate::error::PublishError::OrderingKeyPaused(())),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In a possible future PR, is it possible to clean these up so that we don't have to have a unit type value at all?

@suzmue suzmue merged commit 8281b44 into googleapis:main Feb 13, 2026
34 checks passed
@PhongChuong PhongChuong changed the title fix(pubsub)!: Publish now returns PublishError instead of Arc<gax::error> fix(pubsub)!: return PublishError from Publish instead of an Arc<gax::error> Feb 14, 2026
coryan pushed a commit to coryan/google-cloud-rust that referenced this pull request Feb 18, 2026
…ublish (googleapis#4681)

Switch Publisher Publish to return PublishError instead of Arc.

For SendError, the application can inspect the source of the send error.
The source is wrapped in Arc as an error in a Batch send can cause
multiple Publish errors.

The tests are also updated to check for the new error type.

For googleapis#4650
@PhongChuong PhongChuong deleted the pubsubError branch February 19, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants