Return error if there's an error when getting a leader