Catching and logging exceptions from cron jobs