Typing Errors in Catch Clauses

Опубликовано: 07 Ноябрь 2024
на канале: TypeScript TV with Benny
8,960
121

Learn how to add a type annotation to an error object within a try-catch statement. https://typescript.tv/best-practices/...

My FREE programming apps:
https://apps.apple.com/app/id659282498
https://play.google.com/store/apps/de...

My FREE TypeScript Course:
https://typescript.tv/

Timeline:
00:00 - Problem Scenario
01:12 - Error TS1196: Catch clause variable type annotation
02:51​ - What is a type guard?
03:17​ - What is a type predicate?
04:10 - AxiosError type
05:07 - Writing a type guard
06:49​ - Using a type guard
07:03 - Benefits of type guards

Follow Us:
🌐 https://typescript.tv/​
🐦   / typescripttv  
📺    / typescripttv​  

Hashtags:
#TypeScript​ #WebDev #Programming #TS1196 #TypeScriptTV