-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
-
Fully Compatible
-
Execution Team 2022-08-22
-
36
The utility to throw WriteConflictException allows exceptions to be thrown without context. This makes it very difficult to diagnose errors that get returned to users (or JS tests in our case).
We should remove the defaulted empty context from throwWriteConflictException and fill-in the ~30 places which currently use it with some more useful context.
Also, the message "WriteConflict error: this operation conflicted with another operation. Please retry your operation or multi-document transaction." is a bit redundant and should perhaps be reworded like this:
str::stream() << "WriteConflict occurred due to " << context << ". Please retry your operation or multi-document transaction."