error handling — when ai's code crashes mid-flight6 / 9
catching the right error — not 'anything that goes wrong'
Cursor wrote except Exception: around a dict lookup. That blanket
catches every error class, including bugs you'd rather see. The function
should only swallow the specific failure of "the key isn't there" and
return "unknown". Any other exception should fly through.
Replace Exception on line 4 with the specific exception class for a
missing dict key. Output stays unknown.
The break is on line 4 — but read the whole snippet first.
⌘↵ runs the editor.
Booting Python…
Output
[promptdojo:~]$ _