Brainlag

Debugging

What the red message means, why it happens and how to find it. Every page has a broken program to fix.

How to read any error

  1. Read the last line first. It names the error and usually the thing it tripped on.
  2. Find the line number. That is where it noticed, which is often just after where it went wrong.
  3. Say what you expected. What did you think that value or name was at that moment?
  4. Check it. Print the value, or read the line out loud, before changing anything.
  5. Change one thing, run again. A new error is progress: you got further.

Python

Web

SQL

C