use thiserror::Error;
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum Error {
#[error("The number of labels {expected} does not match the count anticipated from the data matrix {actual}")]
IncorrectMatrixLabels { expected: usize, actual: usize },
#[error("Line {line} does not contain enough columns (need at least {needed}): '{content}'")]
NotEnoughColumns {
line: usize,
needed: usize,
content: String,
},
#[error("Line {line} has too many columns when expecting single value: '{content}'")]
TooManyColumns { line: usize, content: String },
#[error("Invalid value at line {line}: '{content}'")]
ParseError { line: usize, content: String },
#[error(
"Incorrect number of data values: {n_data}; expected a square matrix packed row-wise."
)]
WrongNumberOfData { n_data: usize },
#[error("I/O error: {0}")]
IoError(#[from] std::io::Error),
}