[CDRIVER-3524] Provide an idiomatic way for user callbacks to set unknown errors Created: 06/Feb/20 Updated: 10/Feb/23 |
|
| Status: | Backlog |
| Project: | C Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Samantha Ritter (Inactive) | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Epic Link: | Improve Developer Experience |
| Description |
|
User callbacks to `with_transaction` are expected to return false and set a `bson_error_t` in case of failure. However, if a user callback is reporting a user-side error in their own code (not reporting back a different libmongoc error), there are no error codes/domains they can use to represent their failure. Let's either provide some way to signal an "unknown error" to the driver, or document that users should set the error code and domain to 0 or another well known value. |