Command Palette

Search for a command to run...

Hectal
Phase 12: AI That Runs in the Browser
AI Frontend · Exercise 4 of 5 PreviousNext
Intermediate

Survive a Full Disk

Three buttons try to save a model to a pretend cache with a 500-byte quota using saveToCache(kind, size). Write save(kind, size) so #status says: Saved for next time on success, Not enough space. Running without saving. for a QuotaExceededError, and Something went wrong for any other error.

The feature must keep working when saving fails, so never let the quota error escape.

What Check tests

  1. A small model is saved
  2. A big model hits the quota and the app carries on
  3. Any other error is reported differently

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.