Skip to content

Commit

Permalink
Fix new Typescript rules
Browse files Browse the repository at this point in the history
  • Loading branch information
brrygrdn committed Feb 21, 2022
1 parent 594834d commit 91c778d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
9 changes: 7 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion src/dry-run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ async function check (args: any): Promise<void> {
process.exit(1)
}
} catch (exception) {
console.log(exception.message)
if (exception instanceof Error) {
console.log(exception.message)
} else {
console.log('There was an unexpected error.')
}
process.exit(1)
}
}
Expand Down
6 changes: 5 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ export async function run (): Promise<void> {
core.setFailed(`Api Error: (${error.status}) ${error.message}`)
return
}
core.setFailed(error.message)
if (error instanceof Error) {
core.setFailed(error.message)
} else {
core.setFailed('There was an unexpected error.')
}
}
}

Expand Down

0 comments on commit 91c778d

Please sign in to comment.