mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
Revert per-resource wrap rethrow; record and continue
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.
This commit is contained in:
1 parent
e325782f76
commit
da8205e8f3
1 file changed
+1
-3
@@ -400,8 +400,6 @@ class Appwrite extends Destination
|
|||||||
default => throw new \Exception('Invalid resource group', Exception::CODE_VALIDATION),
|
default => throw new \Exception('Invalid resource group', Exception::CODE_VALIDATION),
|
||||||
};
|
};
|
||||||
} catch (\Throwable $e) {
|
} 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());
|
$resource->setStatus(Resource::STATUS_ERROR, $e->getMessage());
|
||||||
|
|
||||||
$this->addError(new Exception(
|
$this->addError(new Exception(
|
||||||
@@ -413,7 +411,7 @@ class Appwrite extends Destination
|
|||||||
previous: $e
|
previous: $e
|
||||||
));
|
));
|
||||||
|
|
||||||
throw $e;
|
$responseResource = $resource;
|
||||||
} finally {
|
} finally {
|
||||||
$this->dbForProject->setPreserveDates(false);
|
$this->dbForProject->setPreserveDates(false);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user