codex-lv2-may-2025

Level Navigation: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Current Level: 21 22 23 24 25 26 27 28 29 30 31 32 33 34

Level 21: AI Error Handling (Optional Challenge)

What You’ll Do

Add proper error handling to your AI model calls.

Instructions

💡 Code Hints

Need help with AI error handling? Check out these snippets:

✅ Check

  1. Open your webpage in a browser
  2. Click the button to trigger your AI call
  3. You should see the AI response in the output area
  4. Temporarily break your AI API URL (add “x” to the end)
  5. Click the button again - you should see a user-friendly error message
  6. Fix the AI API URL and test again - it should work normally



Level Navigation: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Current Level: 21 22 23 24 25 26 27 28 29 30 31 32 33 34