It is possible for the server to give us back a write concern error (and probably also a non-write concern error) without the errmsg field set. Per pavithra.vetriselvan@mongodb.com, it's an optional field.
However, the driver expects it to always be present, and errors if it receives such an error without this field. I discovered this doing a POC of the test in https://github.com/mongodb/specifications/pull/1367/files where the failpoint sets an error with no errmsg.
To better guard against any issues with this and to ensure we can pass the test added in DRIVERS-2468, we should update our Serde logic to default all errmsg values to an empty string if they are not present in the server reply.
- depends on
-
RUST-1567 Add a test that drivers emit a CommandSucceededEvent when ok=1 and a writeConcernError is returned
- Closed