Skip to content

Conversation

@eramongodb
Copy link
Contributor

Followup to #1543 upon realizing that it is not necessary to special-case specific array fields for purposes of v_noabi::operation_exception compatibility: the entire reply document can simply be propagated through v1::exception to the v1 -> v_noabi conversion helper. This also maximizes backward compatibility with any user code which may expect certain fields to be present in .raw_server_error() regardless of its relevance to any particular operation (including mongoc-specific fields).

Unfortunately the reply document cannot be moved out of the v1::exception object due to catch-by-lvalue-ref-to-const. Catch-by-value may slice the exception object, and catch-by-rvalue-ref is not permitted. Const-cast trickery or use of a global variable were both considered but rejected (KISS).

@eramongodb eramongodb requested a review from kevinAlbs December 15, 2025 22:09
@eramongodb eramongodb self-assigned this Dec 15, 2025
@eramongodb eramongodb requested a review from a team as a code owner December 15, 2025 22:09
Copy link
Collaborator

@kevinAlbs kevinAlbs left a comment

Choose a reason for hiding this comment

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

Propagating the entire reply seems like a reasonable simplification. LGTM.

@eramongodb eramongodb merged commit cadbc0a into mongodb:master Dec 16, 2025
5 of 14 checks passed
@eramongodb eramongodb deleted the cxx-exception-helpers branch December 16, 2025 16:55
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