Skip to content

Commit

Permalink
fix(github): try/catch getPrList
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed Feb 11, 2020
1 parent f23d06c commit c2f28bd
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions lib/platform/github/index.ts
Expand Up @@ -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;
Expand Down

0 comments on commit c2f28bd

Please sign in to comment.