diff --git a/dev/tool/src/markup.ts b/dev/tool/src/markup.ts index 7c194924ff..8b889614d9 100644 --- a/dev/tool/src/markup.ts +++ b/dev/tool/src/markup.ts @@ -197,8 +197,12 @@ async function processMigrateMarkupFor ( const blob = await storageAdapter.stat(ctx, workspaceId, documentId) // only for documents not in storage if (blob === undefined) { - const ydoc = markupToYDoc(value, attribute.name) - await saveCollaborativeDoc(storageAdapter, workspaceId, collaborativeDoc, ydoc, ctx) + try { + const ydoc = markupToYDoc(value, attribute.name) + await saveCollaborativeDoc(storageAdapter, workspaceId, collaborativeDoc, ydoc, ctx) + } catch (err) { + console.error('failed to process document', doc._class, doc._id, err) + } } } } diff --git a/models/core/src/migration.ts b/models/core/src/migration.ts index 7282d9ae27..8b3130a753 100644 --- a/models/core/src/migration.ts +++ b/models/core/src/migration.ts @@ -230,8 +230,12 @@ async function processMigrateContentFor ( const blob = await storageAdapter.stat(ctx, client.workspaceId, documentId) // only for documents not in storage if (blob === undefined) { - const ydoc = markupToYDoc(value, attribute.name) - await saveCollaborativeDoc(storageAdapter, client.workspaceId, collaborativeDoc, ydoc, ctx) + try { + const ydoc = markupToYDoc(value, attribute.name) + await saveCollaborativeDoc(storageAdapter, client.workspaceId, collaborativeDoc, ydoc, ctx) + } catch (err) { + console.error('failed to process document', doc._class, doc._id, err) + } } update[attributeName] = collaborativeDoc