Problem Statement
Safest catch (e) type under strict:
Explanation
`unknown` forces you to check and narrow before using the error value. It avoids the unsafe, anything-goes behavior of `any`.
Code Solution
SolutionRead Only
try {
// ...
} catch (e: unknown) {
if (e instanceof Error) console.error(e.message);
else console.error('Unknown error');
}