Skip to content

Commit

Permalink
Add catch createDocuments
Browse files Browse the repository at this point in the history
  • Loading branch information
fogelito committed Aug 1, 2024
1 parent caef939 commit 4054978
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Migration/Destinations/Appwrite.php
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,7 @@ protected function createIndex(Index $resource): bool
* @throws AuthorizationException
* @throws DatabaseException
* @throws StructureException
* @throws Exception
*/
protected function createDocument(Document $resource, bool $isLast): bool
{
Expand Down Expand Up @@ -908,6 +909,14 @@ protected function createDocument(Document $resource, bool $isLast): bool
'database_' . $databaseInternalId . '_collection_' . $collectionInternalId,
$this->documentBuffer
);

} catch (\Throwable $e) {
throw new Exception(
resourceName: $resource->getName(),
resourceGroup: $resource->getGroup(),
resourceId: $resource->getId(),
message: 'createDocuments failed: ' . $e->getMessage(),
);
} finally {
$this->documentBuffer = [];
}
Expand Down

0 comments on commit 4054978

Please sign in to comment.