diff --git a/jobs/create-group-version-branch.js b/jobs/create-group-version-branch.js index b92a19f4..e343b9d2 100644 --- a/jobs/create-group-version-branch.js +++ b/jobs/create-group-version-branch.js @@ -380,7 +380,9 @@ async function createPr ({ ghqueue, title, body, base, head, owner, repo, log }) repo })) } catch (err) { + log.warn('Could not create PR', { err }) if (err.code !== 422) throw err + const allPrs = await ghqueue.read(github => github.pullRequests.getAll({ base, head: owner + ':' + head, diff --git a/jobs/create-initial-pr.js b/jobs/create-initial-pr.js index d6c25f80..bad620ea 100644 --- a/jobs/create-initial-pr.js +++ b/jobs/create-initial-pr.js @@ -149,7 +149,7 @@ module.exports = async function ( } } catch (err) { if (err.code !== 422) { - log.error('Could not create initial pr') + log.error('Could not create initial pr', {err}) throw err } diff --git a/jobs/create-initial-subgroup-pr.js b/jobs/create-initial-subgroup-pr.js index ef966c76..67ce6e4d 100644 --- a/jobs/create-initial-subgroup-pr.js +++ b/jobs/create-initial-subgroup-pr.js @@ -112,7 +112,7 @@ module.exports = async function ( } } catch (err) { if (err.code !== 422) { - log.error('Could not create initial subgroup pr') + log.error('Could not create initial subgroup pr', {err}) throw err } @@ -125,8 +125,11 @@ module.exports = async function ( head: `${owner}:${head}` })))[0] log.warn('pr was already created', {pullRequestInfo: pr}) - id = pr.id - number = pr.number + + if (pr) { + id = pr.id + number = pr.number + } } await upsert( diff --git a/jobs/create-version-branch.js b/jobs/create-version-branch.js index 03ff3a04..20a145ec 100644 --- a/jobs/create-version-branch.js +++ b/jobs/create-version-branch.js @@ -401,7 +401,9 @@ async function createPr ({ ghqueue, title, body, base, head, owner, repo, log }) repo })) } catch (err) { + log.warn('Could not create PR', { err }) if (err.code !== 422) throw err + const allPrs = await ghqueue.read(github => github.pullRequests.getAll({ base, head: owner + ':' + head,