Welcome to When Things Go Wrong: Errors and Debugging! An error report isn’t damage. It’s information: what went wrong, where, and which calls led there.
In this course, you’ll build a season log for Ruth Abebe, who keeps the Hilltop Running Club’s records. When it’s finished, the season log reports and skips each bad run, then prints every runner’s totals:
Skipped: Run 22: distance isn't a number, got undefined
Skipped: Run 24: date must be YYYY-MM-DD, got "5/24/2026"
Skipped: Run 25: minutes aren't a number, got "forty"
Tomás Herrera (2026-05-16): 10 km in 52 min
Ruth Abebe (2026-05-16): 5 km in 28 min
Grace Kim (2026-05-16): 5 km in 26 min
Kwame Mensah (2026-05-16): 8 km in 38 min
Priya Nair (2026-05-16): 5 km in 32 min
Ruth Abebe (2026-05-23): 8 km in 44 min
Priya Nair (2026-05-23): 5 km in 30 min
Kwame Mensah (2026-05-23): 10 km in 50 min
Tomás Herrera (2026-05-30): 8 km in 45 min
Grace Kim (2026-05-30): 5 km in 25 min
Ruth Abebe: 2 runs, 13 km, 72 min
Priya Nair: 2 runs, 10 km, 62 min
Tomás Herrera: 2 runs, 18 km, 97 min
Grace Kim: 2 runs, 10 km, 51 min
Kwame Mensah: 2 runs, 18 km, 88 min
Members send Ruth their runs by message, and a few arrive wrong, with a missing distance, a date written month first, and minutes typed as a word. Last time, one bad run stopped Ruth’s whole log. On the way to the finished season log, you’ll track down a crash, and a total that’s wrong with no error.
What You’ll Learn
By the end of this course, you’ll be able to:
- Read a stack trace to find where a failure starts
- Catch only the errors your code can handle
- Throw errors with useful messages, and catch them at the right level
- Track down a wrong result with a method instead of guessing
- Build Ruth’s season log, and explain how it works
Before You Start
You should already know how to split a program into modules, load JSON from a file, and follow the call stack. You’ll need a current Node.js LTS, a terminal, and any editor. Node 26 ran every example.
This is the sixth course on the Intermediate JavaScript path. If you’re new here, Ruth’s story starts in the next lesson.
How the Course Works
You’ll run every example in your terminal. Each section ends with a browser exercise, checked by tests. In the project, you’ll build the season log, then explain it to the AI mentor, which reviews it with you. A quiz closes the course.
Next up is the text lesson Read an Error From the Top.