Skip to content

Add tests when upsert fails due to a BulkWriteException #2771

@GromNaN

Description

@GromNaN

I fixed some exception class name in #2770, but the test suite was passing even if the exception class in the catch block doesn't exist, proving a test is missing.

foreach ($this->queuedUpserts as $oid => $document) {
try {
$this->executeUpsert($document, $options);
$this->handleCollections($document, $options);
unset($this->queuedUpserts[$oid]);
} catch (BulkWriteException $e) {
unset($this->queuedUpserts[$oid]);
throw $e;
}
}

On a quick research, this piece of code was added by 8251bb9

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions