error handling — when ai's code crashes mid-flight7 / 9
raising errors — making your code fail loudly on purpose
Cursor wrote a function that catches an exception, logs it, and was
supposed to re-raise so the caller still sees the failure. Instead it
catches, logs, and silently returns None. The script then crashes
later in a confusing place because a downstream call gets None.
Add a single line so that after the print on line 5, the same
exception keeps propagating. The bare raise keyword (no class, no
message) re-raises the exception that was just caught.
Expected output:
logging: bad input
caught at top: bad input
The break is on line 5 — but read the whole snippet first.
⌘↵ runs the editor.
Booting Python…
Output
[promptdojo:~]$ _