Skip to content
Snippets Groups Projects
Commit c2f28bdd authored by Rhys Arkins's avatar Rhys Arkins
Browse files

fix(github): try/catch getPrList

parent f23d06c5
No related branches found
No related tags found
No related merge requests found
...@@ -974,11 +974,17 @@ export async function getPrList(): Promise<Pr[]> { ...@@ -974,11 +974,17 @@ export async function getPrList(): Promise<Pr[]> {
logger.trace('getPrList()'); logger.trace('getPrList()');
if (!config.prList) { if (!config.prList) {
logger.debug('Retrieving PR list'); logger.debug('Retrieving PR list');
const res = await api.get( let res;
try {
res = await api.get(
`repos/${config.parentRepo || `repos/${config.parentRepo ||
config.repository}/pulls?per_page=100&state=all`, config.repository}/pulls?per_page=100&state=all`,
{ paginate: true } { paginate: true }
); );
} catch (err) /* istanbul ignore next */ {
logger.info({ err }, 'getPrList err');
throw new Error('platform-failure');
}
config.prList = res.body.map( config.prList = res.body.map(
(pr: { (pr: {
number: number; number: number;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment