Wrap scheduled task in a try catch