Usually, the exception, thrown by assert.commandFailedWithCode(result) will contain the result's error code.
That is important when this assertion is wrapped in something like retryOnRetriableErrors (example).
However, on some variants (for example, on write errors) this doesn't happen.
- related to
-
SERVER-95656 Inspect the writeErrors vector to check for NoProgressMade error code
-
- Closed
-