...

/

Exceptions and Fibers

Exceptions and Fibers

This lesson explains how to handle exceptions while using fibers.

We'll cover the following...

Earlier, you saw how “an exception object that is thrown from a lower level function is transferred to the higher level functions one level at a time.” We also discussed how an uncaught exception “causes the program to finally exit the main() function.” The described behavior of the exception mechanism can also be achieved by the call stack.

Stack unwinding

Continuing with the first example in this chapter, if an exception is thrown ...