Handling errors with TypeScript's union types | Hacker News Reader