From 054c99f671438ba874c987d06cc8e303e49637ba Mon Sep 17 00:00:00 2001 From: Rhys Arkins <rhys@arkins.net> Date: Sat, 15 Feb 2020 21:50:56 +0100 Subject: [PATCH] fix(helm): gracefully handle invalid URLs --- lib/datasource/helm/index.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/datasource/helm/index.ts b/lib/datasource/helm/index.ts index cd262dd5fa..6fc18ec337 100644 --- a/lib/datasource/helm/index.ts +++ b/lib/datasource/helm/index.ts @@ -21,6 +21,14 @@ export async function getRepositoryData( return null; } } catch (err) { + // istanbul ignore if + if (err.code === 'ERR_INVALID_URL') { + logger.info( + { helmRepository: repository }, + 'helm repository is not a valid URL - skipping' + ); + return null; + } // istanbul ignore if if (err.code === 'ENOTFOUND' || err.code === 'EAI_AGAIN') { logger.info({ err }, 'Could not connect to helm repository'); @@ -41,7 +49,10 @@ export async function getRepositoryData( logger.info({ repository }, 'Unsupported protocol'); return null; } - logger.warn({ err }, `${repository} lookup failure: Unknown error`); + logger.warn( + { err }, + `helm datasource ${repository} lookup failure: Unknown error` + ); return null; } try { -- GitLab