Python Quest

Track 9 · Lesson 6 of 11

Custom exceptions

Define your own exception classes and small hierarchies so callers can catch exactly the problems they care about.

About 35 minIntermediate4 exercises

You will be able to

  • Define a custom exception class with one line of class syntax
  • Raise and catch your own exception types
  • Build a small hierarchy with a base class so callers can catch a whole family of errors
  • Order except clauses from most specific to most general

Included with a Formula Quest membership

It has 4 graded exercises with feedback, hints and solutions. Python Quest is included in Formula Quest memberships that cover Python; membership and billing are managed on Formula Quest.

View Formula Quest memberships

Tracks 1 and 2, the first lesson of every track, the playground and the dataset library are free.