#14 Catch exceptions and write them to a log file