Skip to content

Commit f944ad3

Browse files
committed
Catch query exception on bulk update/delete
1 parent df27669 commit f944ad3

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

  • src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk

src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk/Delete.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ public function action(string $databaseId, string $collectionId, array $queries,
124124
throw new Exception($this->getConflictException());
125125
} catch (RestrictedException) {
126126
throw new Exception($this->getRestrictedException());
127+
} catch (QueryException $e) {
128+
throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage());
127129
}
128130

129131
foreach ($documents as $document) {

src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk/Update.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ public function action(string $databaseId, string $collectionId, string|array $d
150150
throw new Exception(Exception::RELATIONSHIP_VALUE_INVALID, $e->getMessage());
151151
} catch (StructureException $e) {
152152
throw new Exception($this->getStructureException(), $e->getMessage());
153+
} catch (QueryException $e) {
154+
throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage());
153155
}
154156

155157
foreach ($documents as $document) {

0 commit comments

Comments
 (0)