From 17f60b611b45a9f4bbbf7d0a26f6770f08cb9993 Mon Sep 17 00:00:00 2001 From: fogelito Date: Sun, 11 Jan 2026 08:13:39 +0200 Subject: [PATCH 1/3] catch --- src/Appwrite/Deletes/Targets.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/Appwrite/Deletes/Targets.php b/src/Appwrite/Deletes/Targets.php index 794ab0b87a..b1e7dca63b 100644 --- a/src/Appwrite/Deletes/Targets.php +++ b/src/Appwrite/Deletes/Targets.php @@ -3,9 +3,11 @@ namespace Appwrite\Deletes; use Appwrite\Extend\Exception; +use Utopia\Console; use Utopia\Database\Database; use Utopia\Database\Document; use Utopia\Database\Query; +use Utopia\Database\Exception\Limit as LimitException; class Targets { @@ -42,12 +44,17 @@ class Targets MESSAGE_TYPE_PUSH => 'pushTotal', default => throw new Exception('Invalid target provider type'), }; - $database->decreaseDocumentAttribute( - 'topics', - $topicId, - $totalAttribute, - min: 0 - ); + + try { + $database->decreaseDocumentAttribute( + 'topics', + $topicId, + $totalAttribute, + min: 0 + ); + } catch (LimitException $e){ + Console::error("delete subscribers limit reached (topicId={$topicId}): {$e->getMessage()}"); + } } } ); From 893c1aa669ac7e56435ba90c0937796c7d023877 Mon Sep 17 00:00:00 2001 From: fogelito Date: Sun, 11 Jan 2026 08:21:30 +0200 Subject: [PATCH 2/3] formatting --- src/Appwrite/Deletes/Targets.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Appwrite/Deletes/Targets.php b/src/Appwrite/Deletes/Targets.php index b1e7dca63b..b3a1e0ccb1 100644 --- a/src/Appwrite/Deletes/Targets.php +++ b/src/Appwrite/Deletes/Targets.php @@ -6,8 +6,8 @@ use Appwrite\Extend\Exception; use Utopia\Console; use Utopia\Database\Database; use Utopia\Database\Document; -use Utopia\Database\Query; use Utopia\Database\Exception\Limit as LimitException; +use Utopia\Database\Query; class Targets { @@ -52,7 +52,7 @@ class Targets $totalAttribute, min: 0 ); - } catch (LimitException $e){ + } catch (LimitException $e) { Console::error("delete subscribers limit reached (topicId={$topicId}): {$e->getMessage()}"); } } From d08a6f572c3c103689dba7ce14f7c9b0d3941b5d Mon Sep 17 00:00:00 2001 From: fogelito Date: Sun, 11 Jan 2026 08:30:52 +0200 Subject: [PATCH 3/3] message --- src/Appwrite/Deletes/Targets.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Appwrite/Deletes/Targets.php b/src/Appwrite/Deletes/Targets.php index b3a1e0ccb1..5ba667d823 100644 --- a/src/Appwrite/Deletes/Targets.php +++ b/src/Appwrite/Deletes/Targets.php @@ -53,7 +53,7 @@ class Targets min: 0 ); } catch (LimitException $e) { - Console::error("delete subscribers limit reached (topicId={$topicId}): {$e->getMessage()}"); + Console::error("Delete subscribers decreaseDocumentAttribute (topicId={$topicId}): {$e->getMessage()}"); } } }