Skip to content

Commit

Permalink
remove trying to catch error too early
Browse files Browse the repository at this point in the history
  • Loading branch information
FireLemons committed Feb 6, 2022
1 parent d4cf389 commit 59f5fc9
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,18 +217,9 @@ async function stripLabelsFromCardIssue (card, labels) {
throw new Error(`Failed to extract issue number from url: ${card.content_url}`)
}

let issueLables
const issueLables = await getIssueLabels(parseInt(issueNumber))
const issueNumber = issueNumberMatchCapture[1]

try {
issueLables = await getIssueLabels(parseInt(issueNumber))
} catch (e) {
console.error(`Warning: Failed to fetch labels from issue with number "${issueNumber}"`)
console.error(' Skipping unlabeling issue')
console.error(e.message)

continue
}

const newLabels = subtractLabels(issueLables, labels)

Expand Down

0 comments on commit 59f5fc9

Please sign in to comment.