From 6067fb77b704f03ea505ee8b0d283ee36dec0242 Mon Sep 17 00:00:00 2001 From: fogelito Date: Wed, 15 Jan 2025 13:40:41 +0200 Subject: [PATCH] Return on Dependency --- src/Appwrite/Platform/Workers/Databases.php | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/Appwrite/Platform/Workers/Databases.php b/src/Appwrite/Platform/Workers/Databases.php index e913dfb350..aa2a189902 100644 --- a/src/Appwrite/Platform/Workers/Databases.php +++ b/src/Appwrite/Platform/Workers/Databases.php @@ -14,6 +14,7 @@ use Utopia\Database\Exception\Conflict; use Utopia\Database\Exception\NotFound; use Utopia\Database\Exception\Restricted; use Utopia\Database\Exception\Structure; +use Utopia\Database\Exception\Dependency; use Utopia\Database\Query; use Utopia\Logger\Log; use Utopia\Platform\Action; @@ -278,16 +279,6 @@ class Databases extends Action $dbForProject->deleteDocument('attributes', $relatedAttribute->getId()); } - } catch (DatabaseException\Dependency $e) { - Console::error($e->getMessage()); - - $attribute->setAttribute('status', 'available'); - $attribute->setAttribute('error', $e->getMessage()); - - $dbForProject->updateDocument('attributes', $attribute->getId(), $attribute); - - return; - } catch (NotFound $e) { Console::error($e->getMessage()); @@ -319,6 +310,10 @@ class Databases extends Action ); } + if ($e instanceof Dependency) { + return; + } + throw $e; } finally { $this->trigger($database, $collection, $attribute, $project, $projectId, $events);