Skip to content

Commit 8bfe625

Browse files
committed
Add type annotation unknown to object on catch statement
1 parent 4a94139 commit 8bfe625

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

typescript/euler/main.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ if (Deno.args.length > 0) {
2020

2121
console.log(`Answer: ${result}`);
2222
console.log(`Elapsed time: ${duration_ms} msec.`);
23-
} catch (err) {
24-
console.error(err.message);
23+
} catch (err: unknown) {
24+
if (err instanceof Error) {
25+
console.error(err.message);
26+
}
2527
}
2628
} else {
2729
console.log(`Entry point solve() isn't exist in '${filename}'.`);

0 commit comments

Comments
 (0)