-
Type: New Feature
-
Resolution: Unresolved
-
Priority: Unknown
-
None
-
Component/s: None
-
None
-
Needed
-
Summary
A number of drivers use concrete types to model error responses from the server. As a result, when the server adds a new field to the error response for a command, users cannot actually see the new information.
Rather than having drivers try to exhaustively model every possible field, this ticket proposes that to alleviate issues of missing error information, all drivers must somehow expose the full response document from the server when there is an error. This will future-proof us for cases where more information is added to any error responses in the future. The exact API for this will be up to each driver given the variety of error APIs we have across languages.
There is not a natural place to specify this behavior, but to ensure the requirement is captured somewhere in case e.g. we write a driver in a new language, we also would like to add spec tests for this behavior. This may require an addition to the unified test format to support asserting on the response document.
Motivation
Who is the affected end user?
All driver users.
How does this affect the end user?
The end user is not always able to get access to all of the information the server returns when a command fails.
How likely is it that this problem or use case will occur?
The only known instance of this problem right now occurs with the response to the collMod command, where errors can now have a violations property. This is discussed on DRIVERS-2353. However, the server may add more fields like this to command responses in the future, increasing the likelihood of users running into this.
If the problem does occur, what are the consequences and how severe are they?
Since the user is missing information it is hard/impossible for them to understand the error and take action on it.
Is this issue urgent?
The collMod change above was released in v5.2 of the server so users may already be running into this.
Is this ticket required by a downstream team?
Yes, this prevents mongosh from providing equivalent information in error responses to that the legacy shell provided. See MONGOSH-1250.
Is this ticket only for tests?
No, this ticket includes functional changes. That said, for some drivers such as Python that already expose the error response this will be a test-only change.
- related to
-
MONGOSH-1250 [MONGOSH] Incomplete output from collMod operation
- Closed
-
DRIVERS-2470 Extra write and write concern error fields may be inaccessible in modeled write results
- Backlog
- split to
-
CSHARP-4250 Provide access to raw result document when the server returns an error for a command
- Backlog
-
CXX-2543 Provide access to raw result document when the server returns an error for a command
- Backlog
-
RUST-1405 Provide access to raw result document when the server returns an error for a command
- Backlog
-
CDRIVER-4425 Provide access to raw result document when the server returns an error for a command
- Closed
-
GODRIVER-2487 Provide access to raw result document when the server returns an error for a command
- Closed
-
JAVA-4676 Provide access to raw result document when the server returns an error for a command
- Closed
-
MOTOR-992 Provide access to raw result document when the server returns an error for a command
- Closed
-
NODE-4404 Provide access to raw result document when the server returns an error for a command
- Closed
-
RUBY-3049 Provide access to raw result document when the server returns an error for a command
- Closed
-
PHPLIB-909 Spec tests for expectedError.errorResponse assertions
- Closed
-
PYTHON-3351 Provide access to raw result document when the server returns an error for a command
- Closed