From 05ce6de1d372a3745ccf83710b4d581cf0cec89c Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@arkins.net>
Date: Fri, 25 Jan 2019 14:51:55 +0100
Subject: [PATCH] fix(bundler): catch and warn about missing credentials

---
 lib/manager/bundler/artifacts.js | 8 +++++++-
 lib/workers/branch/index.js      | 4 ++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/lib/manager/bundler/artifacts.js b/lib/manager/bundler/artifacts.js
index 8994a36363..998db43eae 100644
--- a/lib/manager/bundler/artifacts.js
+++ b/lib/manager/bundler/artifacts.js
@@ -154,9 +154,15 @@ async function getArtifacts(
     ) {
       throw new Error('bundler-fs');
     }
+    if (
+      err.stdout &&
+      err.stdout.includes('Please supply credentials for this source')
+    ) {
+      throw new Error('bundler-credentials');
+    }
     logger.info(
       { err, message: err.message },
-      'Failed to generate bundler.lock (unknown error)'
+      'Failed to generate Gemfile.lock (unknown error)'
     );
     throw new Error('bundler-unknown');
   }
diff --git a/lib/workers/branch/index.js b/lib/workers/branch/index.js
index 747edf5fdd..cbd4e0b5d7 100644
--- a/lib/workers/branch/index.js
+++ b/lib/workers/branch/index.js
@@ -327,6 +327,10 @@ async function processBranch(branchConfig, prHourlyLimitReached, packageFiles) {
       logger.warn(
         'It is necessary to run Renovate in gitFs mode - contact your bot administrator'
       );
+    } else if (err.message === 'bundler-credentials') {
+      logger.warn(
+        'Bundler credentials are necessary in order to generate Gemfile.lock updates'
+      );
     } else if (err.message === 'bundler-unknown') {
       logger.warn('Unknown bundler error');
     } else if (
-- 
GitLab