Merge pull request #9834 from appwrite/fix-missing-catch

Catch query exception on get document for selects
This commit is contained in:
Jake Barnby 2025-05-20 14:32:20 +00:00 committed by GitHub
commit 727bac5f3d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 7 deletions

View file

@ -3785,7 +3785,12 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen
throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage());
}
$document = $dbForProject->getDocument('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $documentId, $queries);
try {
$document = $dbForProject->getDocument('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $documentId, $queries);
} catch (QueryException $e) {
throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage());
}
if ($document->isEmpty()) {
throw new Exception(Exception::DOCUMENT_NOT_FOUND);
}

12
composer.lock generated
View file

@ -4059,16 +4059,16 @@
},
{
"name": "utopia-php/platform",
"version": "0.7.6",
"version": "0.7.7",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/platform.git",
"reference": "6bc7fbb43ec2b7f9ee5bdef5d4b5e4a81860950b"
"reference": "8c43cd866148a7c4c495e3401268429e338004b3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/platform/zipball/6bc7fbb43ec2b7f9ee5bdef5d4b5e4a81860950b",
"reference": "6bc7fbb43ec2b7f9ee5bdef5d4b5e4a81860950b",
"url": "https://api.github.com/repos/utopia-php/platform/zipball/8c43cd866148a7c4c495e3401268429e338004b3",
"reference": "8c43cd866148a7c4c495e3401268429e338004b3",
"shasum": ""
},
"require": {
@ -4103,9 +4103,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/platform/issues",
"source": "https://github.com/utopia-php/platform/tree/0.7.6"
"source": "https://github.com/utopia-php/platform/tree/0.7.7"
},
"time": "2025-05-18T20:31:24+00:00"
"time": "2025-05-20T09:23:44+00:00"
},
{
"name": "utopia-php/pools",