Python Automation Cookbook
上QQ阅读APP看书,第一时间看更新

Capturing errors and problems

An automated task's main characteristic is its fire-and-forget quality. We are not actively looking at the result, but making it run in the background.

Also, as most of the recipes in this book deal with external information, such as web pages or other reports, the likelihood of finding an unexpected problem when running it is high. This recipe will present an automated task that will safely store unexpected behaviors in a log file that can be checked afterwards.