Skip to content

Commit

Permalink
audit: Only report audit as being unsupported on 404 and >= 500
Browse files Browse the repository at this point in the history
Credit: @iarna
  • Loading branch information
iarna committed May 5, 2018
1 parent 35de046 commit 1822379
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/audit.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function auditCmd (args, cb) {
}).then((auditReport) => {
return audit.submitForFullReport(auditReport)
}).catch((err) => {
if (err.statusCode >= 400) {
if (err.statusCode === 404 || err.statusCode >= 500) {
const ne = new Error(`Your configured registry (${npm.config.get('registry')}) does not support audit requests.`)
ne.code = 'ENOAUDIT'
ne.wrapped = err
Expand Down

0 comments on commit 1822379

Please sign in to comment.