Practice · 1 of 2
App Exception Family
CHALLENGE
Difficulty: intermediate+25 XP
Define AppError(Exception), ValidationError(AppError), and NotFoundError(AppError). Then implement get_item(items: dict, key) that raises NotFoundError (message must contain the key) for missing keys and returns the value otherwise.
Press Submit to check your solution.
Back to lesson: Practice: Exception Hierarchy Drills