Skip to content

Commit 5ff0cc9

Browse files
committed
Fix error catch syntax for TS 4.4.2
It looks like the catch parameter type can only be `any` or `unknown` now and by default it's `any`, so it needs to be explicitly cast to access its properties. Thanks to https://stackoverflow.com/a/64452845
1 parent 4a12b6a commit 5ff0cc9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/setup-bats.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ async function run(): Promise<void> {
1313
// console.log(
1414
// `##[add-matcher]${path.join(matchersPath, "bats-matcher.json")}`
1515
// );
16-
} catch (error) {
17-
core.setFailed(error.message)
16+
} catch (error: unknown) {
17+
const {message} = error as Error
18+
core.setFailed(message)
1819
}
1920
}
2021

0 commit comments

Comments
 (0)