From 6be15eee0c9b78cdbbabd4a4068a21684642b6bc Mon Sep 17 00:00:00 2001 From: fogelito Date: Thu, 28 Nov 2024 11:59:43 +0200 Subject: [PATCH] try catch not found --- src/Appwrite/Platform/Workers/Databases.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Appwrite/Platform/Workers/Databases.php b/src/Appwrite/Platform/Workers/Databases.php index b027b3e707..f9073465cd 100644 --- a/src/Appwrite/Platform/Workers/Databases.php +++ b/src/Appwrite/Platform/Workers/Databases.php @@ -11,6 +11,7 @@ use Utopia\Database\Document; use Utopia\Database\Exception as DatabaseException; use Utopia\Database\Exception\Authorization; use Utopia\Database\Exception\Conflict; +use Utopia\Database\Exception\NotFound; use Utopia\Database\Exception\Restricted; use Utopia\Database\Exception\Structure; use Utopia\Database\Query; @@ -273,6 +274,18 @@ class Databases extends Action if (!$relatedAttribute->isEmpty()) { $dbForProject->deleteDocument('attributes', $relatedAttribute->getId()); } + + } catch (NotFound $e) { + Console::error($e->getMessage()); + + $dbForProject->deleteDocument('attributes', $attribute->getId()); + + if (!$relatedAttribute->isEmpty()) { + $dbForProject->deleteDocument('attributes', $relatedAttribute->getId()); + } + + throw $e; + } catch (\Throwable $e) { Console::error($e->getMessage());