Skip to content

Commit

Permalink
feat(ocorrencias): Trata erro ao processar eml
Browse files Browse the repository at this point in the history
  • Loading branch information
Phenome committed Feb 8, 2024
1 parent 4f674f0 commit bec21c7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/ocorrencia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,12 @@ await Promise.all([
])

for (const { repositorio, kingdom, tag, url } of iptSources) {
console.debug(`Processing ${repositorio}:${tag}`)
const eml = await getEml(`${url}eml.do?r=${tag}`)
console.debug(`Processing ${repositorio}:${tag}\n${url}eml.do?r=${tag}`)
const eml = await getEml(`${url}eml.do?r=${tag}`).catch((error) => {
console.log('Erro baixando/processando eml', error.message)
return null
})
if (!eml) continue
const ipt = processaEml(eml)
const dbVersion = ((await iptsCol.findOne({ _id: ipt.id })) as DbIpt | null)
?.version
Expand Down

0 comments on commit bec21c7

Please sign in to comment.