CXX-3238 propagate the entire mongoc reply document to v_noabi::operation_exception #1545
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Followup to #1543 upon realizing that it is not necessary to special-case specific array fields for purposes of
v_noabi::operation_exceptioncompatibility: the entire reply document can simply be propagated throughv1::exceptionto 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::exceptionobject 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).