Add more logging to db put failures

This commit is contained in:
Jon Staab
2025-02-18 17:36:21 -08:00
parent 5fb3fd60ef
commit 15a603cd1c
+10 -1
View File
@@ -38,7 +38,16 @@ export const bulkPut = async (name: string, data: any[]) => {
const tx = db.transaction(name, "readwrite")
const store = tx.objectStore(name)
await Promise.all(data.map(item => store.put(item)))
await Promise.all(
data.map(item => {
try {
store.put(item)
} catch (e) {
console.error(e, item)
}
}),
)
await tx.done
}