INDEX_DEPENDENCY

This commit is contained in:
fogelito
2025-01-15 11:16:10 +02:00
parent f54684133d
commit 42ef7fd2d8
3 changed files with 10 additions and 0 deletions
+5
View File
@@ -731,6 +731,11 @@ return [
'description' => 'Index invalid.',
'code' => 400,
],
Exception::INDEX_DEPENDENCY => [
'name' => Exception::INDEX_DEPENDENCY,
'description' => 'Attribute cannot be renamed or deleted. Please remove the associated index first.',
'code' => 400,
],
/** Project Errors */
Exception::PROJECT_NOT_FOUND => [
+4
View File
@@ -808,6 +808,10 @@ App::error()
break;
case 'Utopia\Database\Exception\NotFound':
$error = new AppwriteException(AppwriteException::COLLECTION_NOT_FOUND, $error->getMessage(), previous: $error);
break;
case 'Utopia\Database\Exception\Dependency':
$error = new AppwriteException(AppwriteException::INDEX_DEPENDENCY, $error->getMessage(), previous: $error);
break;
}
$code = $error->getCode();
+1
View File
@@ -211,6 +211,7 @@ class Exception extends \Exception
public const INDEX_LIMIT_EXCEEDED = 'index_limit_exceeded';
public const INDEX_ALREADY_EXISTS = 'index_already_exists';
public const INDEX_INVALID = 'index_invalid';
public const INDEX_DEPENDENCY = 'index_dependency';
/** Projects */
public const PROJECT_NOT_FOUND = 'project_not_found';