|
|
@@ -286,7 +286,7 @@ class MongoCollection
|
|
|
'errmsg' => $writeError->getMessage(),
|
|
|
];
|
|
|
} catch (\MongoDB\Driver\Exception\Exception $e) {
|
|
|
- ExceptionConverter::toLegacy($e);
|
|
|
+ throw ExceptionConverter::toLegacy($e);
|
|
|
}
|
|
|
|
|
|
if (! $result->isAcknowledged()) {
|
|
|
@@ -341,7 +341,7 @@ class MongoCollection
|
|
|
$this->convertWriteConcernOptions($options)
|
|
|
);
|
|
|
} catch (\MongoDB\Driver\Exception\Exception $e) {
|
|
|
- ExceptionConverter::toLegacy($e);
|
|
|
+ throw ExceptionConverter::toLegacy($e);
|
|
|
}
|
|
|
|
|
|
if (! $result->isAcknowledged()) {
|
|
|
@@ -393,7 +393,7 @@ class MongoCollection
|
|
|
'updatedExisting' => $writeResult->getUpsertedCount() == 0,
|
|
|
];
|
|
|
} catch (\MongoDB\Driver\Exception\Exception $e) {
|
|
|
- ExceptionConverter::toLegacy($e);
|
|
|
+ throw ExceptionConverter::toLegacy($e);
|
|
|
}
|
|
|
|
|
|
if (! $result->isAcknowledged()) {
|
|
|
@@ -433,7 +433,7 @@ class MongoCollection
|
|
|
$this->convertWriteConcernOptions($options)
|
|
|
);
|
|
|
} catch (\MongoDB\Driver\Exception\Exception $e) {
|
|
|
- ExceptionConverter::toLegacy($e);
|
|
|
+ throw ExceptionConverter::toLegacy($e);
|
|
|
}
|
|
|
|
|
|
if (! $result->isAcknowledged()) {
|
|
|
@@ -513,7 +513,7 @@ class MongoCollection
|
|
|
} catch (\MongoDB\Driver\Exception\ConnectionException $e) {
|
|
|
throw new MongoResultException($e->getMessage(), $e->getCode(), $e);
|
|
|
} catch (\MongoDB\Driver\Exception\Exception $e) {
|
|
|
- ExceptionConverter::toLegacy($e, 'MongoResultException');
|
|
|
+ throw ExceptionConverter::toLegacy($e, 'MongoResultException');
|
|
|
}
|
|
|
|
|
|
if ($document) {
|
|
|
@@ -538,7 +538,7 @@ class MongoCollection
|
|
|
try {
|
|
|
$document = $this->collection->findOne(TypeConverter::fromLegacy($query), $options);
|
|
|
} catch (\MongoDB\Driver\Exception\Exception $e) {
|
|
|
- ExceptionConverter::toLegacy($e);
|
|
|
+ throw ExceptionConverter::toLegacy($e);
|
|
|
}
|
|
|
|
|
|
if ($document !== null) {
|
|
|
@@ -606,7 +606,7 @@ class MongoCollection
|
|
|
try {
|
|
|
$this->collection->createIndex($keys, $this->convertWriteConcernOptions($options));
|
|
|
} catch (\MongoDB\Driver\Exception\Exception $e) {
|
|
|
- ExceptionConverter::toLegacy($e);
|
|
|
+ throw ExceptionConverter::toLegacy($e);
|
|
|
}
|
|
|
|
|
|
return [
|
|
|
@@ -697,7 +697,7 @@ class MongoCollection
|
|
|
try {
|
|
|
return $this->collection->count(TypeConverter::fromLegacy($query), $options);
|
|
|
} catch (\MongoDB\Driver\Exception\Exception $e) {
|
|
|
- ExceptionConverter::toLegacy($e);
|
|
|
+ throw ExceptionConverter::toLegacy($e);
|
|
|
}
|
|
|
}
|
|
|
|