DevPath

Stop swallowing a missing record

Mid · debugging · 25 min · runtime python

Brief

A function wraps its body in a bare except and returns None, hiding a missing record. Rewrite it to raise a specific RecordNotFound with the id, and handle that exception at the boundary. Explain why a bare except is harmful.

3 progressive hints are available in the editor.

Public checks

  • raises a specific error — expected: raises RecordNotFound, not None