⬅️ FEM TypeScript Fundamentals
Exceptions
- We can never say
catch (e: Error)
, we can onlycatch (e: any)
orcatch (e: unknown)
. - catch the error as
catch (e: unknown)
, then usinge instanceof OurErrorClass
as a type guard.
Search
⬅️ FEM TypeScript Fundamentals
catch (e: Error)
, we can only catch (e: any)
or catch (e: unknown)
.catch (e: unknown)
, then using e instanceof OurErrorClass
as a type guard.