<type>documentation</type>
<domain>intro</domain>
<id>tutorial</id>
<title>Tutorial: Debug Process Exception Reporting</title>
<date>$Date$</date>
<product>all</product>

Wing's debugger reports any exceptions that would be printed when running the code outside
of the debugger.

Try this out by continuing execution of the debug process with the |continue| ``Debug``
toolbar icon or ``Start / Continue`` in the ``Debug`` menu. Wing will stop on an incorrect
line of code in ``PrintAsHTML`` and report the problem in the `Exceptions
<script:show_panel#panel_type="debug-exceptions">`__ tool:

.. image:: exception.png
  :width: 711
  :height: 523

~~~if WING101:
.. |continue| image:: debug-continue-101.png
  :class: inline-image
~~~
~~~if not WING101:
.. |continue| image:: debug-continue.png
  :class: inline-image
~~~

The ``Exceptions`` tool highlights the current stack frame as you move up and down the
stack. You can click on frames to navigate the exception backtrace, showing the source
code for each frame.

Whenever you are stopped on an exception, the debugger status indicator in the lower left
of Wing's main window turns red.

After reaching an exception in the debugger, you can correct your code, stop the debugger
with the |stop| ``Stop`` icon in the toolbar, and then start debugging again.
~~~if WINGPRO:
But don't do this yet, since we'll be working within the current debug context in
the next section.
~~~

.. |stop| image:: debug-kill.png
  :class: inline-image

~~~if not WING101:
Exception Handling Options
..........................

In Wing Pro and Wing Personal, the debugger provides several exception handling modes,
which differ in how they determine when exceptions should be reported. It is also possible
to ignore specific exceptions and to specify exception types to always report or never
report. Most users will not need to alter these options, but being aware of them is
useful. 

See `Managing Exceptions <ref:debug/managing-exceptions>`__ for details.
~~~

