-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
In 6dc41c4 for PHPC-676, we started throwing a BulkWriteException if a BulkWrite object was executed multiple times. The exception's code was zero (per phongo_throw_exception()) and it did not include a write result object.
As of PHPC-1087 and PHPC-1144, we would like to document that all ServerExceptions (including BulkWriteException) include a code that originates from the server. I propose we instead throw an InvalidArgumentException for the case of PHPC-676. While this represents a behavioral change, I wouldn't consider it a BC-breaking change since InvalidArugmentException is already a possible exception for executeBulkWrite(). Additionally, we never documented that we throw an exception for executing a BulkWrite object multiple times.
With this change, I reckon we can also delete the PHONGO_ERROR_WRITE_FAILED constant.