From 709a8c20baf5fed20d1c166c201f3950aa133902 Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@keylocation.sg>
Date: Thu, 19 Oct 2017 20:45:25 +0200
Subject: [PATCH] refactor: log res if github initRepo fails (#998)

---
 lib/api/github.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/api/github.js b/lib/api/github.js
index 1b768922be..1abbd0b61e 100644
--- a/lib/api/github.js
+++ b/lib/api/github.js
@@ -156,8 +156,9 @@ async function initRepo(repoName, token, endpoint, repoLogger) {
   config.fileList = null;
   config.prList = null;
   const platformConfig = {};
+  let res;
   try {
-    const res = await get(`repos/${repoName}`, {
+    res = await get(`repos/${repoName}`, {
       headers: {
         accept: 'application/vnd.github.loki-preview+json',
       },
@@ -206,7 +207,7 @@ async function initRepo(repoName, token, endpoint, repoLogger) {
       logger.debug('Repository is not initiated');
       throw new Error('uninitiated');
     }
-    logger.error({ err }, 'Unknown GitHub initRepo error');
+    logger.info({ err, res }, 'Unknown GitHub initRepo error');
     throw err;
   }
   return platformConfig;
-- 
GitLab