-
Type: New Feature
-
Resolution: Won't Do
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
v4.4, v4.2
-
Service Arch 2020-04-06
Drivers use the failCommand fail point extensively in spec tests. It seems that with each server release we need to add a new knob to this fail point in order to test new features. In 4.0 we added the "writeConcernError" field (SERVER-35083). In 4.4 we're adding the "errorLabels" field (SERVER-43941).
It might be useful to add a way for the command to specify the entire error document to return instead of just the error code or the errorLabels. For example:
db.adminCommand({ configureFailPoint: "failCommand", mode: "alwaysOn", data: {failCommands: ["find"], errorDoc: {ok: 0, code: 2, errmsg: "my error message", errorLabels: ["Label"]}} }); // Returns {ok: 0, code: 2, errmsg: "my error message", errorLabels: ["Label"]} db.runCommand({find: "collection"}); db.adminCommand({configureFailPoint: "failCommand", mode: "off"});
This would also satisfy SERVER-42239 since the user could add "extraInfo" to the errorDoc.
- duplicates
-
SERVER-42239 Add support for extraInfo in failCommand
- Closed
- related to
-
SERVER-51196 Add "errorMessage" field to failCommand failpoint and ability to toggle error code
- Backlog
-
SERVER-51297 Allow writeErrors to be specified via failCommand
- Backlog
-
SERVER-47535 Ability to mock command responses on the server
- Closed