-
Type: New Feature
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
DRIVERS-478 was previously validated for PHP without creating a ticket, but I believe that was premature as it was based purely on an example using CommandException.
CDRIVER-3147 notes that libmongoc does not expose the servers codeName field on the result document for write operations. In PHP, this means the field is only accessible via CommandException::getResultDocument(), which means BulkWriteException and ExecutionTimeoutException are excluded.
This came up while testing the transaction spec test for "abort ignores TransactionAborted" test from abort.json (PHPLIB-365). In that test, the raw response from mongoc_bulk_operation_execute is:
{ "nInserted" : 0, "nMatched" : 0, "nModified" : 0, "nRemoved" : 0, "nUpserted" : 0, "writeErrors" : [ ], "errorLabels" : [ "TransientTransactionError" ] }
The error message and code are relayed via the bson_error_t struct; however, codeName is entirely absent. This demonstrates that a fix would require both CDRIVER-3147 and a corresponding change in PHPC.
- depends on
-
CDRIVER-3147 CodeNames for command errors not reported in reply of write operations
- Blocked
- is related to
-
DRIVERS-478 Errors raised by drivers should include codeName string from server response
- Implementing
-
PHPLIB-365 Implement test runner for transaction spec tests
- Closed
- related to
-
PHPLIB-468 Implement Convenient API for Transactions
- Closed