Skip to the workspace
Pebellslearn by building
Debugging with an Assistant  ›  Lesson

Read the Error First

Debugging 12 minBefore prompting, read the traceback yourself: the last line says what failed, the lowest line of your own code says where, and you add a guess about why.

vibe coding / Read the Error First

Explore each scene at your own pace.

01 · The rule

The rule

Read the Error First

Kitty's balances page crashes for one flat. The error fills the screen, and the reflex is to copy all of it into the assistant without reading a word. Sometimes that works. But thirty seconds of reading first makes your prompt sharper, teaches you something, and, most importantly, lets you tell whether the assistant's fix addresses the real cause.

The rule

Read the error yourself first: what failed, where, and your guess why.

In Python, a crash prints a traceback:

Traceback (most recent call last):
  File "kitty/app.py", line 42, in balances_page
    rows = compute_balances(db, flat_id)
  File "kitty/balances.py", line 17, in compute_balances
    share = total // len(members)
            ~~~~~~^^~~~~~~~~~~~~~
ZeroDivisionError: division by zero

(Recent Python versions underline the failing part of a line with ~ and ^, as here; older versions leave the underline out, and message wording can differ slightly between versions.) It reads like this:

  • The last line says what failed: the type of error and a message. Here, something was divided by zero.
  • The lines above show the chain of calls, with the most recent call last. Each entry names a file, a line number and a function, then shows that line of code.
  • The lowest entry in your own files is usually where to look. If a traceback runs on into a library, the mistake is still more likely in how your code called it.

Then comes the step that makes it yours: a guess. At line 17, len(members) must be 0. When would a flat have no members? Flat 7's flatmates all moved out last month.

Scene 1 of 5
Hover to wake the cannons. Drag to move, or use arrow keys when focused. Press Enter to fire a shot.