Fix error handling in vSphere agent