Return errors in scheduler functions