class FooError:
pass
try:
1 / 0
except FooError:
pass
class FooError(Exception):
pass
try:
1 / 0
except FooError:
pass
Used when a class which doesn’t inherit from Exception
is used as an
exception in an except clause.