Skip to content
This repository has been archived by the owner on Jul 3, 2019. It is now read-only.

Commit

Permalink
fix(registry): only print one 199 warning (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
BridgeAR authored and zkat committed Jun 9, 2017
1 parent ffda4d4 commit 7f61258
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/fetchers/registry/check-warning-header.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ function checkWarnings (res, registry, opts) {
}
})
BAD_HOSTS.set(registry, true)
if (warnings['199'] && warnings['199'].message.match(/ENOTFOUND/)) {
opts.log.warn('registry', `Using stale data from ${registry} because the host is inaccessible -- are you offline?`)
}
if (warnings['199']) {
opts.log.warn('registry', `Unexpected warning for ${registry}: ${warnings['199'].message}`)
if (warnings['199'].message.match(/ENOTFOUND/)) {
opts.log.warn('registry', `Using stale data from ${registry} because the host is inaccessible -- are you offline?`)
} else {
opts.log.warn('registry', `Unexpected warning for ${registry}: ${warnings['199'].message}`)
}
}
if (warnings['111']) {
// 111 Revalidation failed -- we're using stale data
Expand Down

0 comments on commit 7f61258

Please sign in to comment.