Skip to content

Commit dfda0e1

Browse files
committed
Improve docs
1 parent 944bdea commit dfda0e1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Database/Database.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Utopia\Database;
44

55
use Exception;
6-
use Swoole\Database\PDOStatementProxy;
6+
use PDOException;
77
use Utopia\Cache\Cache;
88
use Utopia\CLI\Console;
99
use Utopia\Database\Exception as DatabaseException;
@@ -1440,11 +1440,12 @@ public function deleteCollection(string $id): bool
14401440
foreach ($relationships as $relationship) {
14411441
$this->deleteRelationship($collection->getId(), $relationship->getId());
14421442
}
1443-
1443+
14441444
$this->adapter->deleteCollection($id);
1445-
} catch (PDOStatementProxy $e) {
1445+
} catch (PDOException $e) {
14461446
// HACK: Metadata should still be updated, can be removed when null tenant collections are supported.
1447-
if($e->getCode() === '42S02') {
1447+
// "42S02" is "Base table or view not found": https://learn.microsoft.com/en-us/sql/odbc/reference/appendixes/appendix-a-odbc-error-codes?view=sql-server-ver16
1448+
if ($e->getCode() === '42S02') {
14481449
if (!$this->adapter->getSharedTables() || !$this->isMigrating()) {
14491450
throw $e;
14501451
}

0 commit comments

Comments
 (0)