From c2f28bdd95dc52ecb51b8219a3905e2725bcad7d Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@arkins.net>
Date: Tue, 11 Feb 2020 12:22:48 +0100
Subject: [PATCH] fix(github): try/catch getPrList

---
 lib/platform/github/index.ts | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/lib/platform/github/index.ts b/lib/platform/github/index.ts
index 7b2e2df3e6..83147c58ad 100644
--- a/lib/platform/github/index.ts
+++ b/lib/platform/github/index.ts
@@ -974,11 +974,17 @@ export async function getPrList(): Promise<Pr[]> {
   logger.trace('getPrList()');
   if (!config.prList) {
     logger.debug('Retrieving PR list');
-    const res = await api.get(
-      `repos/${config.parentRepo ||
-        config.repository}/pulls?per_page=100&state=all`,
-      { paginate: true }
-    );
+    let res;
+    try {
+      res = await api.get(
+        `repos/${config.parentRepo ||
+          config.repository}/pulls?per_page=100&state=all`,
+        { paginate: true }
+      );
+    } catch (err) /* istanbul ignore next */ {
+      logger.info({ err }, 'getPrList err');
+      throw new Error('platform-failure');
+    }
     config.prList = res.body.map(
       (pr: {
         number: number;
-- 
GitLab