Return on Dependency

This commit is contained in:
fogelito 2025-01-15 13:40:41 +02:00
parent 9f82cd78fb
commit 6067fb77b7

View file

@ -14,6 +14,7 @@ use Utopia\Database\Exception\Conflict;
use Utopia\Database\Exception\NotFound;
use Utopia\Database\Exception\Restricted;
use Utopia\Database\Exception\Structure;
use Utopia\Database\Exception\Dependency;
use Utopia\Database\Query;
use Utopia\Logger\Log;
use Utopia\Platform\Action;
@ -278,16 +279,6 @@ class Databases extends Action
$dbForProject->deleteDocument('attributes', $relatedAttribute->getId());
}
} catch (DatabaseException\Dependency $e) {
Console::error($e->getMessage());
$attribute->setAttribute('status', 'available');
$attribute->setAttribute('error', $e->getMessage());
$dbForProject->updateDocument('attributes', $attribute->getId(), $attribute);
return;
} catch (NotFound $e) {
Console::error($e->getMessage());
@ -319,6 +310,10 @@ class Databases extends Action
);
}
if ($e instanceof Dependency) {
return;
}
throw $e;
} finally {
$this->trigger($database, $collection, $attribute, $project, $projectId, $events);