-
Type: Bug
-
Resolution: Won't Do
-
Priority: Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
Original title: BulkWriteException's proxy behavior may violate contract for ServerException
ServerException's documentation states:
Base class for exceptions thrown by the server. The code of this exception and its subclasses will correspond to the original error code from the server.
BulkWriteException extends ServerException through WriteException; however, not all BulkWriteExceptions are derived from server-side errors. Logic in phongo_execute_bulk_write ensures that a BulkWriteException is always thrown once mongoc_bulk_operation_execute() has been called to ensure that an intermediary write result is always accessible (see: PHPC-1373). If an error from mongoc_bulk_operation_execute happens to yield different exception, it will be thrown first and become accessible via BulkWriteException::getPrevious().
This behavior is unintuitive and complicates logic in PHPLIB's test suite that checks whether an exception is a client-side error (since we must unwrap a BulkWriteException to determine the original exception).
- is related to
-
PHPC-1373 WriteResult is inaccessible if executeBulkWrite() encounters socket error
- Closed
- related to
-
PHPLIB-711 isClientError check in unified test runner should unwrap BulkWriteExceptions
- Closed
-
PHPC-2348 Remove WriteException
- Closed