Skip to content

Commit c01b2d8

Browse files
committed
Merge pull request #785
2 parents 5bcfdce + 110d13e commit c01b2d8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

php_phongo.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -673,9 +673,8 @@ bool phongo_execute_bulk_write(mongoc_client_t* client, const char* namespace, p
673673

674674
/* The Write failed */
675675
if (!success) {
676-
if ((error.domain == MONGOC_ERROR_COMMAND && error.code != MONGOC_ERROR_COMMAND_INVALID_ARG) ||
677-
error.domain == MONGOC_ERROR_SERVER || error.domain == MONGOC_ERROR_WRITE_CONCERN) {
678-
phongo_throw_exception(PHONGO_ERROR_WRITE_FAILED TSRMLS_CC, "%s", error.message);
676+
if (error.domain == MONGOC_ERROR_SERVER || error.domain == MONGOC_ERROR_WRITE_CONCERN) {
677+
zend_throw_exception(php_phongo_bulkwriteexception_ce, error.message, error.code TSRMLS_CC);
679678
phongo_add_exception_prop(ZEND_STRL("writeResult"), return_value TSRMLS_CC);
680679
} else {
681680
phongo_throw_exception_from_bson_error_t(&error TSRMLS_CC);

0 commit comments

Comments
 (0)