Merge pull request #10719 from appwrite/fix-error-handler-error

Return empty on no collection, fallback to route validation
This commit is contained in:
Jake Barnby 2025-10-28 17:39:05 +13:00 committed by GitHub
commit b9fb10a379
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5,7 +5,6 @@ namespace Appwrite\Utopia\Request\Filters;
use Appwrite\Extend\Exception;
use Appwrite\Utopia\Request\Filter;
use Utopia\Database\Database;
use Utopia\Database\Exception\NotFound;
use Utopia\Database\Exception\Query as QueryException;
use Utopia\Database\Query;
use Utopia\Database\Validator\Authorization;
@ -146,8 +145,8 @@ class V20 extends Filter
if ($database->isEmpty()) {
return [];
}
} catch (NotFound) {
throw new Exception(Exception::DATABASE_NOT_FOUND);
} catch (\Throwable) {
return [];
}
try {
@ -158,8 +157,8 @@ class V20 extends Filter
if ($collection->isEmpty()) {
return [];
}
} catch (NotFound) {
throw new Exception(Exception::COLLECTION_NOT_FOUND);
} catch (\Throwable) {
return [];
}
$attributes = $collection->getAttribute('attributes', []);