terrainfollow: add exception protection and logging