Better error handling in scheduler job