Command Palette

Search for a command to run...

Hectal
Phase 0: Start Here: AI Features Through a Frontend Developer's Eyes
AI Frontend · Exercise 3 of 5 PreviousNext
Beginner

Check the Status Before You Read

This route is busy the first time: it answers 429. The second time it answers normally. Right now the page shows the server's raw error JSON as if it were the answer.

Fix the click handler: when the response is not ok, leave #answer empty and show Mitra is busy. Please try again. in #error. When it is ok, show the reply in #answer and clear #error.

What Check tests

  1. First click (the server answers 429): #error shows the message and #answer stays empty
  2. Second click (the server answers normally): #answer shows the reply and #error is cleared
  3. The raw server error is never shown to the user

Stuck? One hint at a time

The solution unlocks after your first Check. Try first: that is where the learning happens.

Runs in your browser. Your code is saved here.

Your page

Press Run to see the page.

Console

Nothing logged yet.