diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 675268b894..ec402333e4 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -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); } diff --git a/composer.lock b/composer.lock index 432676ca3e..557b61f36c 100644 --- a/composer.lock +++ b/composer.lock @@ -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",