update: remove not-found and index dependency exceptions from global handler.

This commit is contained in:
Darshan 2025-06-11 16:51:09 +05:30
parent dc439d1a16
commit 86a9598a51
2 changed files with 1 additions and 18 deletions

View file

@ -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();

View file

@ -90,6 +90,7 @@ class Delete extends Action
$collection->getAttribute('indexes'),
$dbForProject->getAdapter()->getSupportForCastIndexArray(),
);
if (!$validator->isValid($attribute)) {
throw new Exception($this->getIndexDependencyException());
}