From 6a3836faf07c09556e2747591b27b2e17ed745ab Mon Sep 17 00:00:00 2001 From: Rhys Arkins <rhys@arkins.net> Date: Wed, 7 Nov 2018 10:52:33 +0100 Subject: [PATCH] fix(gitlab): Gracefully handle 403 during init --- lib/platform/gitlab/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/platform/gitlab/index.js b/lib/platform/gitlab/index.js index efe8c692b3..2cb7f7e945 100644 --- a/lib/platform/gitlab/index.js +++ b/lib/platform/gitlab/index.js @@ -164,11 +164,14 @@ async function initRepo({ await config.storage.initRepo(config); } await Promise.all([getPrList(), getFileList()]); - } catch (err) { + } catch (err) /* istanbul ignore next */ { logger.debug('Caught initRepo error'); if (err.message === 'archived') { throw err; } + if (err.statusCode === 403) { + throw new Error('forbidden'); + } logger.info({ err }, 'Unknown GitLab initRepo error'); throw err; } -- GitLab