mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
Stop createField/createIndex cleanup catches from silencing bugs
The catch (\Throwable) cleanup blocks in createField and createIndex were rewrapping any thrown exception as a Migration\Exception with a generic 'Failed to create column/index' message. With the worker's instanceof MigrationException gate, this silenced real library bugs (TypeError, RuntimeException, PDOException) from Sentry — the exact opposite of what the surrounding PR aims to do. Rethrow the original cause instead, so the safety net at import() records the real message for the user and the worker boundary routes non-MigrationException throwables to Sentry with full trace.
This commit is contained in:
1 parent
7bb1da14e1
commit
e060244b01
1 file changed
+3
-13
@@ -821,19 +821,14 @@ class Appwrite extends Destination
|
||||
throw new \Exception('Failed to create Column', Exception::CODE_INTERNAL);
|
||||
}
|
||||
}
|
||||
} catch (\Throwable) {
|
||||
} catch (\Throwable $e) {
|
||||
$this->dbForProject->deleteDocument('attributes', $column->getId());
|
||||
|
||||
if (isset($twoWayAttribute)) {
|
||||
$this->dbForProject->deleteDocument('attributes', $twoWayAttribute->getId());
|
||||
}
|
||||
|
||||
throw new Exception(
|
||||
resourceName: $resource->getName(),
|
||||
resourceGroup: $resource->getGroup(),
|
||||
resourceId: $resource->getId(),
|
||||
message: 'Failed to create column',
|
||||
);
|
||||
throw $e;
|
||||
}
|
||||
|
||||
if ($type === UtopiaDatabase::VAR_RELATIONSHIP && $options['twoWay']) {
|
||||
@@ -986,12 +981,7 @@ class Appwrite extends Destination
|
||||
} catch (\Throwable $th) {
|
||||
$this->dbForProject->deleteDocument('indexes', $index->getId());
|
||||
|
||||
throw new Exception(
|
||||
resourceName: $resource->getName(),
|
||||
resourceGroup: $resource->getGroup(),
|
||||
resourceId: $resource->getId(),
|
||||
message: 'Failed to create index',
|
||||
);
|
||||
throw $th;
|
||||
}
|
||||
|
||||
$this->dbForProject->purgeCachedDocument(
|
||||
|
||||
Reference in new issue
Block a user