mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
IndexException
This commit is contained in:
@@ -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
@@ -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.*",
|
||||
|
||||
Reference in New Issue
Block a user