Blog
Mert Özen's blog posts on software development, backend, frontend, and DevOps.
Series
2 posts found
#discriminated-union
Frontend
PART 12
Error Handling in TypeScript: unknown in catch, Narrowing Errors and the Result Pattern
We look at why the catch variable is unknown, narrowing with instanceof Error, custom error classes, Promise pitfalls, and modeling errors with Result and discriminated unions.
3 Nov 2026
9 min
1
Frontend
PART 09
Narrowing in TypeScript: Shrinking Unions with Control Flow Analysis
We see how TypeScript narrows unions through control flow analysis: typeof, truthiness, equality, in and instanceof checks, discriminated unions and exhaustive checks with never.
3 Nov 2026
8 min
1