Catching the right error — not 'anything that goes wrong' — step 6 of 9
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.
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.
this step needs the editor
on desktop today; in the app (coming soon). save your spot and we'll bring you back here when you're ready.