Chapter 12 - Recovering from Failure
We need to be sure our
Camp function calls the
Extinguish method before the program exits. But right now,
Camp is returning early due to an error, before
Extinguish can be called.
We don’t want to leave a lit
Fire unattended in the forest! Revise the
Camp function so that
Extinguish is always called, even if
Camp returns early.
Fire lit: true
Fire lit: false
Error: spotted a bear