Skip to content

Commit

Permalink
upgrade Node dependencies, including typescript
Browse files Browse the repository at this point in the history
Also fix some error handling type issues.

Signed-off-by: Jakub Sokołowski <[email protected]>
  • Loading branch information
jakubgs committed Jan 11, 2022
1 parent dffdedb commit 6aa243a
Show file tree
Hide file tree
Showing 3 changed files with 1,184 additions and 1,101 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"smee-client": "^1.0.2",
"ts-jest": "^24.0.0",
"tslint": "^5.12.1",
"typescript": "3.2.1",
"typescript": "^4.5.4",
"typescript-eslint-parser": "^18.0.0",
"typescript-tslint-plugin": "^0.2.1"
},
Expand Down
9 changes: 7 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,11 @@ Pull requests: ${Humanize.oxford(checkSuite.pull_requests.map((pr) => pr.url), 5
return createResponse
}
} catch (e) {
/* Error of unknown type has to be handled */
if (!(e instanceof Error)) {
throw e
}
context.log.error(e)

// Report error back to GitHub
check.status = 'completed'
check.conclusion = 'cancelled'
Expand Down Expand Up @@ -286,7 +289,9 @@ async function updateRunAsync(context: Context, check: Octokit.ChecksUpdateParam
if (--attempts <= 0) {
throw error
}
context.log.warn(`error while updating check run, will try again in 30 seconds: ${error.message}`)
if (error instanceof Error) {
context.log.warn(`error while updating check run, will try again in 30 seconds: ${error.message}`)
}
await timeout(30000)
}
}
Expand Down
Loading

0 comments on commit 6aa243a

Please sign in to comment.