You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/richtext-lexical/src/utilities/migrateSlateToLexical/index.ts
+29-13Lines changed: 29 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -64,12 +64,20 @@ async function migrateGlobal({
64
64
})
65
65
66
66
if(found){
67
-
awaitpayload.updateGlobal({
68
-
slug: global.slug,
69
-
data: document,
70
-
depth: 0,
71
-
locale: locale||undefined,
72
-
})
67
+
try{
68
+
awaitpayload.updateGlobal({
69
+
slug: global.slug,
70
+
data: document,
71
+
depth: 0,
72
+
locale: locale||undefined,
73
+
})
74
+
// Catch it, because some errors were caused by the user previously (e.g. invalid relationships) and will throw an error now, even though they are not related to the migration
75
+
}catch(e){
76
+
console.log('Error updating global',e,{
77
+
id: document.id,
78
+
slug: global.slug,
79
+
})
80
+
}
73
81
}
74
82
}
75
83
@@ -136,13 +144,21 @@ async function migrateCollection({
136
144
})
137
145
138
146
if(found){
139
-
awaitpayload.update({
140
-
id: document.id,
141
-
collection: collection.slug,
142
-
data: document,
143
-
depth: 0,
144
-
locale: locale||undefined,
145
-
})
147
+
try{
148
+
awaitpayload.update({
149
+
id: document.id,
150
+
collection: collection.slug,
151
+
data: document,
152
+
depth: 0,
153
+
locale: locale||undefined,
154
+
})
155
+
// Catch it, because some errors were caused by the user previously (e.g. invalid relationships) and will throw an error now, even though they are not related to the migration
0 commit comments