OutcomeOS
Menu

  AI Trap of the Week · Review & hallucination · tricky

The "robust" error handler

You asked the AI to make a fetch helper "more robust." It produced this. Looks fine on inspection?

export async function getUser(id: string): Promise<User | null> {
  try {
    const r = await fetch(`/api/users/${id}`);
    return await r.json();
  } catch (e) {
    console.error('failed', e);
    return null;
  }
}

Is there a defect?

◆ Past traps

  • Review & hallucination · spotter

    The flaky test "fix"

    Try it →
  • Context engineering · tricky

    The "timezone-aware" fix that isn't

    Try it →
  • Review & hallucination · spotter

    The plausible-looking pandas import

    Try it →
Full archive →