From da8205e8f3e927b2b860dddc2efca0e408171116 Mon Sep 17 00:00:00 2001 From: Prem Palanisamy Date: Tue, 5 May 2026 16:50:58 +0100 Subject: [PATCH] Revert per-resource wrap rethrow; record and continue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The earlier 'throw $e' aborted the batch on the first failure, leaving items #6-N at STATUS_PENDING and skipping the rest of the source's fetch loop. Restore the original 'absorb-and-continue' shape so every resource in the batch is attempted and recorded — failures all land in the migration report and the user retries the run cleanly. Trade-off: library bugs (TypeError, etc.) caught here are absorbed and don't reach Sentry. Acceptable — the deterministic-bug case fails the same way for every resource, so absorbing produces a uniform 'all errored' report instead of '1 errored + N pending'. User errors are still kept out of Sentry by the worker's instanceof MigrationException gate, which is the primary goal of this PR. --- src/Migration/Destinations/Appwrite.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Migration/Destinations/Appwrite.php b/src/Migration/Destinations/Appwrite.php index fd7a7c7095..38673cbbd1 100644 --- a/src/Migration/Destinations/Appwrite.php +++ b/src/Migration/Destinations/Appwrite.php @@ -400,8 +400,6 @@ class Appwrite extends Destination default => throw new \Exception('Invalid resource group', Exception::CODE_VALIDATION), }; } catch (\Throwable $e) { - // Safety net for unexpected failures — record on the migration and - // rethrow so the worker boundary can route bugs to Sentry. $resource->setStatus(Resource::STATUS_ERROR, $e->getMessage()); $this->addError(new Exception( @@ -413,7 +411,7 @@ class Appwrite extends Destination previous: $e )); - throw $e; + $responseResource = $resource; } finally { $this->dbForProject->setPreserveDates(false); }