[SERVER-10160] gen_error_codes.py should generate a js module with symbolic constants for the error codes in the shell. Created: 10/Jul/13 Updated: 16/Mar/16 Resolved: 17/Aug/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Shell |
| Affects Version/s: | None |
| Fix Version/s: | 3.1.7 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Andy Schwerin | Assignee: | Calvin Chan |
| Resolution: | Done | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Participants: | |||||||||
| Description |
|
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. |
| Comments |
| Comment by Ian Whalen (Inactive) [ 19/Aug/15 ] |
|
https://github.com/mongodb/mongo/commit/ea25f4c281237d4b43f86a3ca8c9d1fddeaeb8fc |
| Comment by Calvin Chan [ 04/Aug/15 ] |
|
Submitted a preliminary code review. Abstracted C++ generator code to allow easier extensibility of error code generator to other languages. |