Skip to content

Improve handling of Errors - #2038

Open
stIncMale wants to merge 2 commits into
mongodb:mainfrom
stIncMale:JAVA-6110
Open

Improve handling of Errors#2038
stIncMale wants to merge 2 commits into
mongodb:mainfrom
stIncMale:JAVA-6110

Conversation

@stIncMale

@stIncMale stIncMale commented Aug 14, 2026

Copy link
Copy Markdown
Member

Introduced ExceptionUtils.rethrowIfError/mapUnlessError, inspired by InternalStreamConnection.rethrowIfError/translateReadFailure, to facilitate handling Errors.

The test failures look not worse than those in main.

AI usage

Claude (Opus (1M context), xhigh effort) was thoroughly used to review the changes, and was extremely helpful.

No changes were generated with AI.

JAVA-6110

final SingleResultCallback<ServerTuple> callback) {
if (isClosed()) {
callback.onResult(null, new MongoClientException("Cluster was closed during server selection."));
return;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is a legitimate bug fix, not merely an improvement.

@stIncMale
stIncMale requested review from rozza and removed request for strogiyotec August 14, 2026 03:23
@stIncMale
stIncMale marked this pull request as ready for review August 14, 2026 03:25
@stIncMale
stIncMale requested a review from a team as a code owner August 14, 2026 03:25
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