Skip to content

Glossary: Python Beyond the Basics

exception

Also written: Exception, custom exception, raise

An error object. You create your own kind with a class that inherits from `Exception`, like OutOfStockError, and `raise` it when something goes wrong.

Where the book teaches it

Related terms

try / except / else / finallyinheritance