diff --git a/lib/core.js b/lib/core.js index f9255a2..9dfec6a 100644 --- a/lib/core.js +++ b/lib/core.js @@ -723,8 +723,7 @@ async function checkMerge(context, pullRequest) { } else if (isMergeCheckError(error)) { context.log.debug(ctx, `skipping: ${error.message}`); } else { - context.log.error(ctx, 'skipping: merge check error'); - context.log.error(error); + throw error; } return false; @@ -932,6 +931,10 @@ function getEffectiveReviewTeams(teams, reviewers, requestedTeams) { */ async function getTeamsWithMembers(context, pullRequest, reviewTeams) { + const ctx = context.repo({ + pull_number: pullRequest.number + }); + const org = getPullRequestTargetOrg(pullRequest); const teamMembers = await Promise.all(reviewTeams.map(async (teamSlug) => { @@ -943,6 +946,8 @@ async function getTeamsWithMembers(context, pullRequest, reviewTeams) { team_slug: teamSlug }).catch(error => { + context.log.debug(ctx, `failed to fetch team ${teamSlug}`, error); + // app is missing missing permissions if (error.status === 403) { throw MergeCheckError(`failed to fetch team ${org}/${teamSlug} (status=403)`);