error handling — when ai's code crashes mid-flight6 / 9
try/except — catching what ai didn't
Claude shipped this and it "worked" for weeks before someone noticed the
function was hiding a typo. The bare except: swallows everything,
including the real bug. Replace the bare except: with one that catches
only ValueError. The output should be fallback.
The break is on line 4 — but read the whole snippet first.
⌘↵ runs the editor.
Booting Python…
Output
[promptdojo:~]$ _