From c4d3b3dfb405ea0e1cefae92cc52b18eb8240ccd Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@arkins.net>
Date: Wed, 16 May 2018 07:03:27 +0200
Subject: [PATCH] refactor: pass bad credentials error from branch to repo

---
 lib/workers/branch/index.js | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/workers/branch/index.js b/lib/workers/branch/index.js
index 274cdbbae7..5c2ddea639 100644
--- a/lib/workers/branch/index.js
+++ b/lib/workers/branch/index.js
@@ -196,6 +196,10 @@ async function processBranch(branchConfig, packageFiles) {
       logger.debug('Passing repository-changed error up');
       throw err;
     }
+    if (err.message === 'bad-credentials') {
+      logger.debug('Passing bad-credentials error up');
+      throw err;
+    }
     if (err.message === 'lockfile-error') {
       logger.info('Lock file error');
     } else if (err.message !== 'registry-failure') {
-- 
GitLab