From 9999f47bf6f54ca8fb441b8890775056a7e566e8 Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Mon, 13 May 2019 15:42:24 +0200 Subject: [PATCH] fix(rubygems): throw registry-failure when failing to download --- lib/datasource/rubygems/get-rubygems-org.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/datasource/rubygems/get-rubygems-org.js b/lib/datasource/rubygems/get-rubygems-org.js index 55e1409766..ae65ed6f0c 100644 --- a/lib/datasource/rubygems/get-rubygems-org.js +++ b/lib/datasource/rubygems/get-rubygems-org.js @@ -21,13 +21,13 @@ async function updateRubyGemsVersions() { logger.debug('Rubygems: Fetching rubygems.org versions'); newLines = (await got(url, options)).body; } catch (err) /* istanbul ignore next */ { - if (err.statusCode === 416) { - logger.debug('Rubygems: No update'); - } else { + if (err.statusCode !== 416) { logger.warn({ err }, 'Rubygems error - resetting cache'); contentLength = 0; packageReleases = Object.create(null); // Because we might need a "constructor" key + throw new Error('registry-failure'); } + logger.debug('Rubygems: No update'); lastSync = new Date(); return; }