[CDRIVER-3661] Documented differences between error API v1 and API v2 are incomplete Created: 08/May/20  Updated: 27/Oct/23  Resolved: 12/May/23

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

Type: Improvement Priority: Minor - P4
Reporter: Kevin Albertson Assignee: Unassigned
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Quarter: FY24Q2

 Description   

The Error Reporting page documents the differences between error API V1 and V2, including a table of the error domain in V1 and corresponding error domain in V2.

The paragraph says:

The driver’s error reporting began with a design flaw: when the error domain is MONGOC_ERROR_COLLECTION, MONGOC_ERROR_QUERY, or MONGOC_ERROR_COMMAND, the error code might originate from the server or the driver.

But the table does not have an entry for MONGOC_ERROR_COLLECTION. I think that is either missing, or the row for mongoc_collection_insert_one() and the other collection write functions is incorrectly documented.



 Comments   
Comment by Kevin Albertson [ 12/May/23 ]

The MONGOC_ERROR_COLLECTION appears to only be returned for client-side errors. The only found instance of returning MONGOC_ERROR_COLLECTION is in [_empty_error](https://github.com/mongodb/mongo-c-driver/blob/69caa27f216f59d116f3dd6e64584f746820d7b4/src/libmongoc/src/mongoc/mongoc-write-command.c#L362-L374) which is only called for a client-side check of a non-empty payload length before sending a write command.

The documentation appears to be correct. Closing as "Works as Designed".

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