Skip to content

Commit 904faaf

Browse files
committed
Fix colledtion not found code error
1 parent 8a17cd5 commit 904faaf

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Database/Adapter/MariaDB.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2288,6 +2288,13 @@ protected function processException(PDOException $e): \Exception
22882288
return new NotFoundException('Collection not found', $e->getCode(), $e);
22892289
}
22902290

2291+
// Unknown collection
2292+
// We have two of same, because docs point to 1051.
2293+
// Keeping previous 1049 (above) just in case it's for older versions
2294+
if ($e->getCode() === '42S02' && isset($e->errorInfo[1]) && $e->errorInfo[1] === 1051) {
2295+
return new NotFoundException('Collection not found', $e->getCode(), $e);
2296+
}
2297+
22912298
return $e;
22922299
}
22932300

0 commit comments

Comments
 (0)