1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
use polars::prelude::PolarsError;
use thiserror::Error;
/// Represents various errors that can occur during formatting operations.
#[derive(Error, Debug)]
pub enum FormatError {
/// Error indicating that the format type could not be parsed.
#[error("Could not parse format type")]
CouldNotParseFormatType,
/// Error indicating a failure in decomposing the coefficient exponent.
#[error("Could not decompose coefficient exponent")]
CouldNotDecomposeCoefficientExponent,
/// Error indicating a failure in creating a regular expression.
#[error("Could not create regex")]
CouldNotCreateRegex,
/// Error when a regex match could not be performed.
#[error("Regex could not match")]
CouldNotMatchRegex,
/// Error indicating an invalid format, with details.
#[error("Invalid format: {0}")]
InvalidFormat(String),
/// Error indicating that the provided data is empty, with details.
#[error("Empty data: {0}")]
EmptyData(String),
/// Error wrapping a `PolarsError` from the `polars` crate.
#[error(transparent)]
PolarsError(#[from] PolarsError),
/// Error indicating a missing column, with the column's name.
#[error("Column missing: {0}")]
ColumnMissing(String),
/// Error indicating an unsupported datatype, with details.
#[error("Unsupported datatype: {0}")]
UnsupportedDatatype(String),
/// Error for mismatched format types, with details.
#[error("Mismatched format type: {0}")]
MismatchedFormatType(String),
/// Error indicating different numbers of rows for columns in a table.
#[error("Different numbers of rows for columns in table")]
DifferentRowCounts,
}