The shell should have symbolic constants for the error codes defined in mongo/base/error_codes.py. A good way would be for gen_error_codes.py or a sister script to generate a .js file that instantiated an object at global scope, called ErrorCodes or perhaps Mongo.ErrorCodes. ErrorCodes would look like:
{ OK: 0, ... Unauthorized: 13, ... }We could even attach a method for stringifying numeric codes, which could be used to improve reporting in the shell.
- is duplicated by
-
SERVER-17791 extend generate_error_codes.py to generate javascript
- Closed