[CXX-834] Return local mongoc errors and server errors in different error spaces Created: 28/Jan/16 Updated: 30/Jun/23 |
|
| Status: | Backlog |
| Project: | C++ Driver |
| Component/s: | API |
| Affects Version/s: | 3.0.0 |
| Fix Version/s: | 4.0.0 |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Andrew Morrow (Inactive) | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | error-handling, internal-woes | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||
| Epic Link: | C++ Error Improvements | ||||||||||||||||||||||||||||||||||||
| Backwards Compatibility: | Major Change | ||||||||||||||||||||||||||||||||||||
| Description |
|
Right now, libmongoc doesn't give us a way to distinguish server side errors from its own local numeric codes. Worse, some of the codes are in conflict. Our only reasonable option is to surface the raw error code to the user with no additional interpretation. Once the C driver has resolved this issue, we should add our own symbolic codes for errors returned by libmongoc to the mongocxx::error_codes enumeration, and populate the mongocxx::server_error_codes enumeration with the contents of error_codes.err. All other server codes that don't have symbolic representations will still be surfaced as a numeric code, which will all map to the same string representation. |
| Comments |
| Comment by David Golden [ 16/Sep/16 ] |
|
Given the degree of API change involved, we've decided to push this out to 4.0. |
| Comment by Andrew Morrow (Inactive) [ 25/May/16 ] |
|
Right, and that will need to happen on the (to be created) 3.1-dev branch. I want to leave the C driver minimum on the 3.0.x release series at C driver 1.3.x. |
| Comment by A. Jesse Jiryu Davis [ 25/May/16 ] |
|
Once libmongoc 1.4 is out, the C++ driver should do: mongoc_client_pool_set_error_api (pool, 2) to get server error codes reported in the new MONGOC_ERROR_SERVER domain. |