Creating custom exception types
suggest changeCreate a class inheriting from Exception:
class FooException(Exception):
pass
try:
raise FooException("insert description here")
except FooException:
print("A FooException was raised.")
or another exception type:
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents