fix(docker): registry-failure for docker.io RequestError

This commit is contained in:
Rhys Arkins 2019-08-14 19:21:41 +02:00
parent 676b15f457
commit cf1bec1e10

View file

@ -103,6 +103,11 @@ async function getAuthHeaders(registry, repository) {
logger.debug({ err }); logger.debug({ err });
return null; return null;
} }
if (err.name === 'RequestError' && registry.endsWith('docker.io')) {
logger.debug({ err }, 'err');
logger.info('Docker registry error: RequestError');
throw new Error('registry-failure');
}
if (err.statusCode === 429 && registry.endsWith('docker.io')) { if (err.statusCode === 429 && registry.endsWith('docker.io')) {
logger.warn({ err }, 'docker registry failure: too many requests'); logger.warn({ err }, 'docker registry failure: too many requests');
throw new Error('registry-failure'); throw new Error('registry-failure');