Skip to content

Commit

Permalink
ignore 404s in dry-run
Browse files Browse the repository at this point in the history
  • Loading branch information
decyjphr committed Nov 1, 2023
1 parent 8ec4892 commit 4998f97
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/plugins/diffable.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,16 @@ module.exports = class Diffable extends ErrorStash {
}
return Promise.all(changes)
}).catch(e => {
this.logError(`Error ${e} in ${this.constructor.name} for repo: ${JSON.stringify(this.repo)} entries ${JSON.stringify(this.entries)}`)
if (this.nop) {
resArray.push(new NopCommand(this.constructor.name, this.repo, null, `error ${e} in ${this.constructor.name} for repo: ${JSON.stringify(this.repo)} entries ${JSON.stringify(this.entries)}`, 'ERROR'))
return Promise.resolve(resArray)
if (e.status === 404) {
// Ignore 404s which can happen in dry-run as the repo may not exist.
return Promise.resolve(resArray)
} else {
resArray.push(new NopCommand(this.constructor.name, this.repo, null, `error ${e} in ${this.constructor.name} for repo: ${JSON.stringify(this.repo)} entries ${JSON.stringify(this.entries)}`, 'ERROR'))
return Promise.resolve(resArray)
}
} else {
this.logError(`Error ${e} in ${this.constructor.name} for repo: ${JSON.stringify(this.repo)} entries ${JSON.stringify(this.entries)}`)
}
})
}
Expand Down

0 comments on commit 4998f97

Please sign in to comment.