Skip to content

Commit 73faf65

Browse files
committed
Simplify
1 parent 6260899 commit 73faf65

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

src/phongo_execute.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -300,20 +300,10 @@ bool phongo_execute_bulk_write(zval* manager, const char* namespace, php_phongo_
300300
if (!success) {
301301
if (error.domain != MONGOC_ERROR_SERVER && error.domain != MONGOC_ERROR_WRITE_CONCERN) {
302302
phongo_throw_exception_from_bson_error_t_and_reply(&error, &reply);
303-
}
304-
305-
/* Argument errors occur before command execution, so there is no need
306-
* to layer this InvalidArgumentException behind a BulkWriteException.
307-
* In practice, this will be a "Cannot do an empty bulk write" error. */
308-
if (error.domain == MONGOC_ERROR_COMMAND && error.code == MONGOC_ERROR_COMMAND_INVALID_ARG) {
309303
goto cleanup;
310304
}
311305

312-
if (EG(exception)) {
313-
phongo_throw_exception_from_bson_error_t_and_reply(&error, &reply);
314-
} else {
315-
zend_throw_exception(php_phongo_bulkwriteexception_ce, error.message, error.code);
316-
}
306+
zend_throw_exception(php_phongo_bulkwriteexception_ce, error.message, error.code);
317307

318308
/* Ensure error labels are added to the final BulkWriteException. If a
319309
* previous exception was also thrown, error labels will already have

0 commit comments

Comments
 (0)