use thiserror::Error;
use crate::profile::Candidate;
#[derive(Debug, Error)]
pub enum Error {
#[error("ballot contains contradictory preferences for pair ({0}, {1})")]
ContradictoryPair(Candidate, Candidate),
#[error("ballot contains duplicate candidate {0}")]
DuplicateCandidate(Candidate),
#[error("candidate index {0} is out of range for {1} candidates")]
InvalidCandidate(Candidate, usize),
#[error("ranking length {0} does not match candidate count {1}")]
InvalidRankingLength(usize, usize),
#[error("ballots disagree on the number of candidates")]
InconsistentCandidateCount,
#[error("margin matrix is not skew-symmetric")]
InvalidMargins,
#[error("no candidates provided")]
NoCandidates,
#[error("the maximal lottery is infeasible")]
Infeasible,
}