-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Fully Compatible
-
Query 2020-06-15, Query 2020-06-29, Query 2020-07-13
-
91
In order for document validation errors to correctly propagate from the server to the user when the collection validator's 'validationAction' is set to error, two components are needed:
- A derived class of 'ErrorExtraInfo' named 'DocumentValidationErrorExtraInfo'. This is the mechanism that will allow for generated errors to be stored right after they are generated and eventually retrieved when the server is constructing the error to be returned so that the generated error can be attached to the 'errInfo' field of the returned error.
- Shell support for exposing the 'errInfo' field in a WriteError. The mongo shell needs to be updated to look for the 'errInfo' field in a WriteError received from the server and attach it when necessary (to get a sense of what this might look like, take a look at the implementation of this support in the POC for this project.
As part of this work, doc_validation.js should be updated to verify that the 'errInfo' field is propagated correctly for DocumentValidationFailure errors both in a standalone as well as a sharded cluster.