Error trapping and logging added to cron app