Running your own cookbooks on your nodes might lead into situations where it does not make any sense to continue the current Chef run. If a critical resource is offline or a mandatory configuration value cannot be determined, it is time to bail out.
However, even if things are not that bad, you might want to log certain events while executing your recipes. Chef offers the possibility to write your custom log messages and exit the current run, if you choose to do so.
In this section, you'll learn how to add log statements and stop Chef runs using exceptions.