Standardized error handling for TypeScript inspired by Go and Rust.
try { const data = await fetchUser(id); } catch (error) { if (error instanceof UserNotFoundError) { return null; } throw error; }