Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-1386

BulkWriteException and ExecutionTimeoutException do not expose codeName for server errors

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Waiting (Blocked)
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                jmikola Jeremy Mikola
                Participants:
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: