{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "ch05-title",
   "metadata": {},
   "source": [
    "# Exceptions & Testing"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ch05-overview",
   "metadata": {},
   "source": [
    "Errors are inevitable in any program. This chapter teaches you to recover from runtime failures and find logic errors before they reach users.\n",
    "\n",
    "- Exception handling for runtime failures\n",
    "- Tracebacks as debugging evidence\n",
    "- Custom exceptions for clearer error reporting\n",
    "- Tests as executable checks of program behavior\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0500-video",
   "metadata": {},
   "source": [
    "<h2>Video</h2>\n",
    "\n",
    "This overview introduces exception handling with try, except, else, and finally.\n",
    "\n",
    "```{raw} html\n",
    "<iframe width=\"100%\" height=\"400\" src=\"https://www.youtube-nocookie.com/embed/NIWwJbo-9_8\" title=\"Python Tutorial: Using Try/Except Blocks for Error Handling\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen referrerpolicy=\"strict-origin-when-cross-origin\"></iframe>\n",
    "```\n",
    "\n",
    "> *[Python Tutorial: Using Try/Except Blocks for Error Handling](https://youtube.com/watch?v=NIWwJbo-9_8) by Corey Schafer*"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ch05-goals",
   "metadata": {},
   "source": [
    "<h2>Learning Goals</h2>\n",
    "\n",
    "By the end of this chapter, you will be able to:\n",
    "\n",
    "1. Distinguish between syntax errors, runtime errors, and semantic errors\n",
    "2. Read and interpret Python tracebacks to locate the source of a bug\n",
    "3. Handle exceptions gracefully with `try`, `except`, `else`, and `finally`\n",
    "4. Raise exceptions and define custom exception classes\n",
    "5. Write `doctest`, `unittest`, and `pytest` tests to verify behavior\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ch05-flow",
   "metadata": {},
   "source": [
    "<h2>Chapter Flow</h2>\n",
    "\n",
    "```{tableofcontents}\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0500-slides",
   "metadata": {},
   "source": [
    "<h2><a href=\"overview.html\" target=\"_blank\" style=\"color: var(--pst-color-link, #176de8);\">Chapter Overview Slides</a></h2>"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
