Every TypeScript developer has written something like this: function getUser ( id : string ): User { const user = db . findUser ( id ); if ( ! user ) throw new Error ( " User not found " ); return user ; } The function signature says it returns a User . But that's a lie. It might throw, and nothing in the type system warns you about it. The caller has to remember to wrap it in try-catch , hope they handle the right err...