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

Use server-side error code for BulkWriteException

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.5.0
    • Affects Version/s: None
    • Component/s: None
    • None

      BulkWriteException has historically used zero as its integer code. With libmongoc error API v2, mongoc_bulk_operation_execute() now reports its errors in the MONGOC_ERROR_SERVER and MONGOC_ERROR_WRITE_CONCERN domains (see: Error Reporting).

      With the introduction of ServerException in PHPC-1087, we now document that codes used for that exception and its sub-classes originate from the server. Since WriteException and BulkWriteException are children of that class, we should also use the error code from libmongoc's bson_errot_t instead of zero.

      As I mentioned in mongodb/mongo-php-driver#781, we can accomplish this by using zend_throw_exception directly.

            Assignee:
            katherine.walker@mongodb.com Katherine Walker (Inactive)
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: