Throw Try/Catch in the 🗑️ Level up your React error handling with the Result type
summary
Argues for replacing try/catch with a Result type (using Neverthrow) and shows concrete patterns: wrap unknown code with try/tryPromise, validate IO with Zod or similar, add tagged errors carrying context, and reserve React Error Boundaries for true defects. Uses a domain-renewal case where the team documents 17 distinct error types, improves telemetry and cuts support tickets, and demonstrates how Result unions let TypeScript track failures across async chains.
AI-written summary · about
chapters (6)
- 0:00Introduction
- 1:13Rethinking error handling
- 3:24The problem with try/catch
- 10:08Case study in better errors
- 13:34The result type explained
- 19:56Practical guide and summary
related talks
31mHow Many Ways to Say I'm Sorry, Error Handling in React
32mCommunicating Intention with Functional TypeScript
32mRailway Oriented TypeScript
25mLeveraging (algebraic data) types to make your UI rock solid
49mTypescript + React
19mHow Typed is Your Framework?
30mSwipe Left, Uncaught TypeError Learning to Love Type Systems
20mBetter Together: Rust & TypeScript
