Skip to content

Update MongoQueryException to extend MongoCommandException #1040

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

Merged
merged 2 commits into from
Nov 9, 2022

Conversation

jyemin
Copy link
Collaborator

@jyemin jyemin commented Nov 7, 2022

The MongoQueryException class currently extends MongoServerException,
the reason being that prior to MongoDB 3.2 the find helper was implemented
using the OP_QUERY wire protocol message, which is not a command. But now
that 3.6 is the minimum required server version, the find helper is always
implemented via the find command. So MongoQueryException can now extend
MongoCommandException and include the full command response document.

JAVA-4676

@jyemin jyemin self-assigned this Nov 7, 2022
@jyemin jyemin requested a review from rozza November 7, 2022 16:55
*
* @return the full response to the command failure.
* @since 4.8
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Treating this as an API addition based on the javadoc

Copy link
Member

@rozza rozza left a comment

Choose a reason for hiding this comment

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

One nit but after LGTM

The MongoQueryException class currently extends MongoServerException,
the reason being that prior to MongoDB 3.2 the find helper was implemented
using the OP_QUERY wire protocol message, which is not a command.  But now
that 3.6 is the minimum required server version, the find helper is always
implemented via the find command.  So MongoQueryException can now extend
MongoCommandException and include the full command response document.

JAVA-4676
@jyemin jyemin merged commit dfe3d89 into mongodb:master Nov 9, 2022
@jyemin jyemin deleted the j4676 branch November 9, 2022 15:53
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