Errors
This commit is contained in:
parent
92f1107e6c
commit
494a2ff91f
|
@ -17,6 +17,7 @@ const start = Date.now()
|
|||
async function batchCreate(apiKey, appId, table, items, batchSize = 100) {
|
||||
let i = 0
|
||||
|
||||
let errors = 0
|
||||
async function createSingleRow(item) {
|
||||
try {
|
||||
const row = await createRow(apiKey, appId, table, item)
|
||||
|
@ -27,7 +28,7 @@ async function batchCreate(apiKey, appId, table, items, batchSize = 100) {
|
|||
)
|
||||
return row
|
||||
} catch {
|
||||
console.error("Error creating row", item)
|
||||
errors++
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,6 +38,9 @@ async function batchCreate(apiKey, appId, table, items, batchSize = 100) {
|
|||
const batchRows = await Promise.all(batchPromises)
|
||||
rows.push(...batchRows)
|
||||
}
|
||||
if (errors) {
|
||||
console.error(`Error creating ${errors} row`)
|
||||
}
|
||||
return rows
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue