Python

Write an awesome doc for Python. A very nice an practical one extracted from Python official documentation.

View on GitHub

Errors or Exceptions

Types of Exceptions

BaseException

Exception

[!TIP]

Best practice: be as specific as possible with the types of exceptions that you intend to handle, and allow any unexpected exceptions to propagate.

Though for debugging purposes we can use this class like this:

try:
    pass
except ValueError:
    # ...
except Exception as e:
    print(f"Debugging, {e}")

Stack Traceback

Traceback

YouTube/Aparat

Ref