From 5b786e2a688da15bbd840fb80a06621dba42c4a8 Mon Sep 17 00:00:00 2001 From: fogelito Date: Mon, 10 Feb 2025 09:19:56 +0200 Subject: [PATCH] Catch index exception --- app/controllers/general.php | 3 +++ composer.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/general.php b/app/controllers/general.php index 7e691d033f..d9d41a16fd 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -837,6 +837,9 @@ App::error() case 'Utopia\Database\Exception\Dependency': $error = new AppwriteException(AppwriteException::INDEX_DEPENDENCY, null, previous: $error); break; + case 'Utopia\Database\Exception\Index': + $error = new AppwriteException(AppwriteException::INDEX_INVALID, $error->getMessage(), previous: $error); + break; } $code = $error->getCode(); diff --git a/composer.json b/composer.json index 8f5bb54f79..d0b457b6bd 100644 --- a/composer.json +++ b/composer.json @@ -51,7 +51,7 @@ "utopia-php/cache": "0.11.*", "utopia-php/cli": "0.15.*", "utopia-php/config": "0.2.*", - "utopia-php/database": "0.56.4", + "utopia-php/database": "dev-index-exception as 0.56.4", "utopia-php/domains": "0.5.*", "utopia-php/dsn": "0.2.1", "utopia-php/framework": "0.33.*",