error handling — when ai's code crashes mid-flight7 / 9
try/except — catching what ai didn't
This function is meant to look up a key in a dict and return a default if
the key isn't there. AI wrote except ValueError, which never matches,
so the missing-key case still crashes. Fix the exception class on line 3
so the script prints unknown.
The break is on line 4 — but read the whole snippet first.
⌘↵ runs the editor.
Booting Python…
Output
[promptdojo:~]$ _