IndexException

This commit is contained in:
fogelito
2025-02-10 10:04:51 +02:00
parent 5b786e2a68
commit 27709e7683
2 changed files with 4 additions and 6 deletions
+3 -5
View File
@@ -27,6 +27,7 @@ use Utopia\Database\Document;
use Utopia\Database\Exception\Authorization as AuthorizationException;
use Utopia\Database\Exception\Conflict as ConflictException;
use Utopia\Database\Exception\Duplicate as DuplicateException;
use Utopia\Database\Exception\Index as IndexException;
use Utopia\Database\Exception\Limit as LimitException;
use Utopia\Database\Exception\NotFound as NotFoundException;
use Utopia\Database\Exception\Query as QueryException;
@@ -384,7 +385,7 @@ function updateAttribute(
$dbForProject->getAdapter()->getInternalIndexesKeys(),
);
foreach ($collection->getAttribute('indexes', []) as $index){
foreach ($collection->getAttribute('indexes', []) as $index) {
if (!$validator->isValid($index)) {
throw new Exception(Exception::INDEX_INVALID, $validator->getDescription());
}
@@ -407,10 +408,7 @@ function updateAttribute(
} catch (LimitException) {
throw new Exception(Exception::ATTRIBUTE_LIMIT_EXCEEDED);
} catch (indexException $e) {
/**
* We do not have index indexException thrown from Utopia...
*/
throw new Exception(Exception::INDEX_INVALID, $e->getDescription());
throw new Exception(Exception::INDEX_INVALID, $e->getMessage());
}
}
+1 -1
View File
@@ -51,7 +51,7 @@
"utopia-php/cache": "0.11.*",
"utopia-php/cli": "0.15.*",
"utopia-php/config": "0.2.*",
"utopia-php/database": "dev-index-exception as 0.56.4",
"utopia-php/database": "0.56.4",
"utopia-php/domains": "0.5.*",
"utopia-php/dsn": "0.2.1",
"utopia-php/framework": "0.33.*",