Skip to main content

Practice · 2 of 2

Catch Order Matters

CHALLENGE
Difficulty: intermediate+25 XP

Given the family above, implement classify(fn) that calls fn() and returns 'validation' if it raises ValidationError, 'notfound' if NotFoundError, 'app' for any other AppError, and 'unknown' for anything else.

Back to lesson: Practice: Exception Hierarchy Drills