Skip to content

Commit

Permalink
Make extra sure that failed Promises are handled
Browse files Browse the repository at this point in the history
We currently catch all exceptions in `run()` and in `cleanup()`, but
ESLint does not quite figure that out.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Oct 30, 2020
1 parent 8904abd commit 4ad3c24
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,13 @@ async function cleanup(): Promise<void> {

// Main
if (!stateHelper.IsPost) {
run()
run().catch(error => {
core.setFailed(error.message)
})
}
// Post
else {
cleanup()
cleanup().catch(error => {
core.setFailed(error.message)
})
}

0 comments on commit 4ad3c24

Please sign in to comment.