JavaScript Fetch Error Handling: Build a Reusable TypeScript Wrapper