mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Fix tests
This commit is contained in:
parent
11538347af
commit
a1e782e39d
2 changed files with 5 additions and 2 deletions
|
|
@ -17,6 +17,7 @@ export const importCsv = async (ctx: ImportContext, stream: Stream) => {
|
|||
// labels follows format: "[label1, label2]"
|
||||
const labels = row.length > 2 ? row[2].slice(1, -1).split(',') : undefined
|
||||
await ctx.urlHandler(ctx, url, state, labels)
|
||||
ctx.countImported++
|
||||
} catch (error) {
|
||||
console.log('invalid url', row, error)
|
||||
ctx.countFailed += 1
|
||||
|
|
|
|||
|
|
@ -155,10 +155,12 @@ const urlHandler = async (
|
|||
state,
|
||||
labels
|
||||
)
|
||||
result ? ctx.countImported++ : ctx.countFailed++
|
||||
if (!result) {
|
||||
return Promise.reject('Failed to import url')
|
||||
}
|
||||
} catch (err) {
|
||||
console.log('error importing url', err)
|
||||
ctx.countFailed += 1
|
||||
throw err
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue