[CDRIVER-17] return value / error reporting overhaul Created: 28/Jun/10  Updated: 19/Oct/16  Resolved: 07/Jul/11

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 0.4

Type: Improvement Priority: Minor - P4
Reporter: dan k Assignee: Kyle Banker
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

all


Backwards Compatibility: Major Change

 Description   

There is currently no way to know whether a bson operation succeeded or failed aside from if the program has exited or not. A different setup by which errors could be handled in the calling program would be preferable.

Currently, most functions in the api return the bson* or bson_buffer* they were provided and exit() on error. In most cases, these pointers are not useful. One possible solution involves returning negative errors on failure, with the option to register an abortive error handler callback.

This type of change would break old code, but make future code significantly more robust.



 Comments   
Comment by auto [ 01/Jun/11 ]

Author:

{u'login': u'banker', u'name': u'Kyle Banker', u'email': u'kylebanker@gmail.com'}

Message: CDRIVER-17 CDRIVER-70 Continued error overhaul. Removed
C-based exception mechanism. getlasterror commands store
result in connection object.
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/ce41c067593db63c18803ad8c3c69c031186bbc9

Comment by auto [ 01/Jun/11 ]

Author:

{u'login': u'banker', u'name': u'Kyle Banker', u'email': u'kylebanker@gmail.com'}

Message: CDRIVER-17 BSON error reporting overhaul
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/9370ecd353da522df7fbd3143392f3db30efb00a

Comment by auto [ 19/May/11 ]

Author:

{u'login': u'banker', u'name': u'Kyle Banker', u'email': u'kylebanker@gmail.com'}

Message: CDRIVER-49 CDRIVER-60 CDRIVER-17 Check field names, utf8, and start of new error API.
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/24e9c5d9bbbc3124ecd52ea18b5575ecc311e540

Generated at Wed Feb 07 21:08:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.