diff --git a/lib/fetchers/registry/check-warning-header.js b/lib/fetchers/registry/check-warning-header.js index 446b1ee..b17a233 100644 --- a/lib/fetchers/registry/check-warning-header.js +++ b/lib/fetchers/registry/check-warning-header.js @@ -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