-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Minor Change
Currently the driver exposes the code name in an attribute of Mongo::Error::OperationFailure, but not in the exception message itself. It would be helpful for diagnostics if the code name was included in the exception message.
Since the message is being changed, I also suggest making it more clear that the error code (in parentheses) comes from the server. Especially for low numbered error codes (1-2 digits), to me, it is frequently not clear that the error code is server-generated.
Looking at the relevant code it seems there is quite a bit of logic to extract error messages from what I assume are ancient server responses of server versions that the driver no longer supports (pre-2.6). The parsing that predates 2.6, if identified, can be removed.
The following errors contain messages that are affected:
OperationFailure (add code name, change formatting)
BulkWriteError (code name not provided by server, change formatting to match OperationFailure)
Auth errors (code name already exposed, change formatting to match OperationFailure)
- is depended on by
-
RUBY-2517 Do not inspect error messages for "not master" or "node is recovering" when error code is present
- Closed
- is related to
-
SERVER-55582 Expose error code names in mongod responses where mongos does
- Backlog
- links to