[CDRIVER-709] Define mongoc_error_code_t value for "duplicate key error" Created: 17/Jun/15 Updated: 19/Oct/16 Resolved: 11/Oct/16 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | docs, errors |
| Affects Version/s: | None |
| Fix Version/s: | 1.5.0 |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Ulticom | Assignee: | A. Jesse Jiryu Davis |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Server OS = CentOS 6.5 |
||
| Issue Links: |
|
||||||||||||||||
| Description |
|
I would like to code our application to trap on this bson_error_t returned by mongoc_collection_insert():
However I don't want to put "magic numbers" in our code, like this:
I would like to code it like this:
Where do I find the enumeration? Thanks, |
| Comments |
| Comment by Githook User [ 11/Oct/16 ] |
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: |
| Comment by A. Jesse Jiryu Davis [ 25/Aug/15 ] |
|
Reopening, the C Driver should provide applications a nice way to check for duplicate key err, as other drivers do, once |
| Comment by Jeremy Mikola [ 17/Jun/15 ] |
|
The C driver's error domains and codes are defined in src/mongoc/mongoc-error.h; however, this is not an exhaustive list of server-side error codes. You may want to consult docs/errors.md in the server repository as well. |