Skip to content

Commit

Permalink
audit: report any errors above 400 as potentially not supporting audit
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Dec 19, 2018
1 parent fb3bbb7 commit 1c99673
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/audit.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ function auditCmd (args, cb) {
}).then((auditReport) => {
return audit.submitForFullReport(auditReport)
}).catch((err) => {
if (err.statusCode === 404 || err.statusCode >= 500) {
const ne = new Error(`Your configured registry (${opts.registry}) does not support audit requests.`)
if (err.statusCode >= 400) {
const ne = new Error(`Your configured registry (${opts.registry}) does not support audit requests, or the audit endpoint is temporarily unavailable.`)
ne.code = 'ENOAUDIT'
ne.wrapped = err
throw ne
Expand Down

0 comments on commit 1c99673

Please sign in to comment.