@@ -1258,26 +1258,26 @@ <h4 id="reraisingcaughtexception">Re-raising caught exception:</h4>
12581258 < span class ="hljs-keyword "> raise</ span >
12591259</ code > </ pre >
12601260< h3 id ="commonbuiltinexceptions "> Common Built-in Exceptions</ h3 >
1261- < pre > < code class ="python language-python hljs "> BaseException
1262- ├── SystemExit < span class =" hljs-comment " > # Raised by the sys.exit() function.</ span >
1263- ├── KeyboardInterrupt < span class =" hljs-comment " > # Raised when the user hits the interrupt key.</ span >
1264- └── Exception < span class =" hljs-comment " > # User-defined exceptions should be derived from this class.</ span >
1265- ├── StopIteration < span class =" hljs-comment " > # Raised by next() when run on an empty iterator.</ span >
1266- ├── ArithmeticError < span class =" hljs-comment " > # Base class for arithmetic errors.</ span >
1267- │ └── ZeroDivisionError < span class =" hljs-comment " > # Raised when dividing by zero.</ span >
1268- ├── AttributeError < span class =" hljs-comment " > # Raised when an attribute is missing.</ span >
1269- ├── EOFError < span class =" hljs-comment " > # Raised by input() when it hits end-of-file condition.</ span >
1270- ├── LookupError < span class =" hljs-comment " > # Raised when a look-up on sequence or dict fails.</ span >
1271- │ ├── IndexError < span class =" hljs-comment " > # Raised when a sequence index is out of range.</ span >
1272- │ └── KeyError < span class =" hljs-comment " > # Raised when a dictionary key is not found.</ span >
1273- ├── NameError < span class =" hljs-comment " > # Raised when a variable name is not found.</ span >
1274- ├── OSError < span class =" hljs-comment " > # Failures such as “file not found” or “disk full”.</ span >
1275- │ └── FileNotFoundError < span class =" hljs-comment " > # When a file or directory is requested but doesn't exist.</ span >
1276- ├── RuntimeError < span class =" hljs-comment " > # Raised by errors that don't fall in other categories.</ span >
1277- │ └── RecursionError < span class =" hljs-comment " > # Raised when the the maximum recursion depth is exceeded.</ span >
1278- ├── TypeError < span class =" hljs-comment " > # Raised when an argument is of wrong type.</ span >
1279- └── ValueError < span class =" hljs-comment " > # When an argument is of right type but inappropriate value.</ span >
1280- └── UnicodeError < span class =" hljs-comment " > # Raised when encoding/decoding strings from/to bytes fails.</ span >
1261+ < pre > < code class ="text language-text "> BaseException
1262+ +-- SystemExit # Raised by the sys.exit() function.
1263+ +-- KeyboardInterrupt # Raised when the user hits the interrupt key.
1264+ +-- Exception # User-defined exceptions should be derived from this class.
1265+ +-- StopIteration # Raised by next() when run on an empty iterator.
1266+ +-- ArithmeticError # Base class for arithmetic errors.
1267+ | +-- ZeroDivisionError # Raised when dividing by zero.
1268+ +-- AttributeError # Raised when an attribute is missing.
1269+ +-- EOFError # Raised by input() when it hits end-of-file condition.
1270+ +-- LookupError # Raised when a look-up on sequence or dict fails.
1271+ | +-- IndexError # Raised when a sequence index is out of range.
1272+ | +-- KeyError # Raised when a dictionary key is not found.
1273+ +-- NameError # Raised when a variable name is not found.
1274+ +-- OSError # Failures such as “file not found” or “disk full”.
1275+ | +-- FileNotFoundError # When a file or directory is requested but doesn't exist.
1276+ +-- RuntimeError # Raised by errors that don't fall in other categories.
1277+ | +-- RecursionError # Raised when the the maximum recursion depth is exceeded.
1278+ +-- TypeError # Raised when an argument is of wrong type.
1279+ +-- ValueError # When an argument is of right type but inappropriate value.
1280+ +-- UnicodeError # Raised when encoding/decoding strings from/to bytes fails.
12811281</ code > </ pre >
12821282< h3 id ="userdefinedexceptions "> User-defined Exceptions</ h3 >
12831283< pre > < code class ="python language-python hljs "> < span class ="hljs-class "> < span class ="hljs-keyword "> class</ span > < span class ="hljs-title "> MyError</ span > < span class ="hljs-params "> (Exception)</ span > :</ span >
0 commit comments