diff --git a/app/controllers/general.php b/app/controllers/general.php index 3a2a4c9d16..138e96f88a 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -1177,24 +1177,6 @@ App::error() case 'Utopia\Database\Exception\Timeout': $error = new AppwriteException(AppwriteException::DATABASE_TIMEOUT, previous: $error); break; - case 'Utopia\Database\Exception\NotFound': - $error = new AppwriteException( - $isTablesAPI - ? AppwriteException::TABLE_NOT_FOUND - : AppwriteException::COLLECTION_NOT_FOUND, - $error->getMessage(), - previous: $error - ); - break; - case 'Utopia\Database\Exception\Dependency': - $error = new AppwriteException( - $isTablesAPI - ? AppwriteException::COLUMN_INDEX_DEPENDENCY - : AppwriteException::INDEX_DEPENDENCY, - null, - previous: $error - ); - break; } $code = $error->getCode(); diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Delete.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Delete.php index 1f31097caf..242f6a4ea0 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Delete.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Delete.php @@ -90,6 +90,7 @@ class Delete extends Action $collection->getAttribute('indexes'), $dbForProject->getAdapter()->getSupportForCastIndexArray(), ); + if (!$validator->isValid($attribute)) { throw new Exception($this->getIndexDependencyException()); }