Skip to content

Commit 91c778d

Browse files
committed
Fix new Typescript rules
1 parent 594834d commit 91c778d

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

dist/index.js

Lines changed: 7 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/dry-run.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,11 @@ async function check (args: any): Promise<void> {
6565
process.exit(1)
6666
}
6767
} catch (exception) {
68-
console.log(exception.message)
68+
if (exception instanceof Error) {
69+
console.log(exception.message)
70+
} else {
71+
console.log('There was an unexpected error.')
72+
}
6973
process.exit(1)
7074
}
7175
}

src/main.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ export async function run (): Promise<void> {
4444
core.setFailed(`Api Error: (${error.status}) ${error.message}`)
4545
return
4646
}
47-
core.setFailed(error.message)
47+
if (error instanceof Error) {
48+
core.setFailed(error.message)
49+
} else {
50+
core.setFailed('There was an unexpected error.')
51+
}
4852
}
4953
}
5054

0 commit comments

Comments
 (0)