Exception handling for GetTasks