pulsar
pulsar copied to clipboard
[improve][client] Throw more meaningful derived exception instead of PulsarClientException
Motivation
Currently we are abuse PulsarClientException
, I think we could use a more meaningful derived exception instead. For example, call acknowledge
on an already closed consumer throws PulsarClientException with message Consumer already closed
, it's hard for caller to determine what kind of exception they catch.
Modifications
It's safe to use a derived exception instead of PulsarClientException.
Verifying this change
- [x] Make sure that the change passes the CI checks.
This change is a trivial rework / code cleanup without any test coverage.
Does this pull request potentially affect one of the following parts:
If yes
was chosen, please highlight the changes
- Dependencies (does it add or upgrade a dependency): (no)
- The public API: (no)
- The schema: (no)
- The default values of configurations: (no)
- The wire protocol: (no)
- The rest endpoints: (no)
- The admin cli options: (no)
- Anything that affects deployment: (no)
Documentation
Check the box below or label this PR directly.
Need to update docs?
- [x]
doc-not-needed
Matching PR in forked repository
PR in forked repository: https://github.com/Shawyeok/pulsar/pull/3
Looks good. We should probably also have assertions in the tests to ensure these proper exception are thrown, so that we don't have regression cases.
Ok, I'll add unit test later.
Looks good. We should probably also have assertions in the tests to ensure these proper exception are thrown, so that we don't have regression cases.
@merlimat Unit test added, PTAL
/pulsarbot rerun-failure-checks
/pulsarbot rerun-failure-checks
/pulsarbot rerun-failure-checks
@lhotari @codelipenghui PTAL
The pr had no activity for 30 days, mark with Stale label.
@Shawyeok Please add the following content to your PR description and select a checkbox:
- [ ] `doc` <!-- Your PR contains doc changes -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->
/pulsarbot rerun-failure-checks
@codelipenghui Please help review this PR, thanks.
/pulsarbot rerun-failure-checks
/pulsarbot rerun-failure-checks
/pulsarbot rerun-failure-checks
/pulsarbot run-failure-checks
Codecov Report
:exclamation: No coverage uploaded for pull request base (
master@92b4708
). Click here to learn what that means. The diff coverage isn/a
.
@@ Coverage Diff @@
## master #15594 +/- ##
=========================================
Coverage ? 50.63%
Complexity ? 6992
=========================================
Files ? 383
Lines ? 41845
Branches ? 4272
=========================================
Hits ? 21190
Misses ? 18395
Partials ? 2260
Flag | Coverage Δ | |
---|---|---|
unittests | 50.63% <0.00%> (?) |
Flags with carried forward coverage won't be shown. Click here to find out more.
/pulsarbot rerun-failure-checks
The pr had no activity for 30 days, mark with Stale label.
Since we will start the RC version of 3.0.0
on 2023-04-11
, I will change the label/milestone of PR who have not been merged.
- The PR of type
feature
is deferred to3.1.0
- The PR of type
fix
is deferred to3.0.1
So drag this PR to 3.0.1