connectorx/sources/csv/errors.rs
1use thiserror::Error;
2
3/// Errors raised by the CSV source.
4#[derive(Error, Debug)]
5pub enum CSVSourceError {
6 /// Generic ConnectorX error.
7 #[error(transparent)]
8 ConnectorXError(#[from] crate::errors::ConnectorXError),
9
10 /// A type inference regular expression failed to build.
11 #[error(transparent)]
12 RegexError(#[from] regex::Error),
13
14 /// The file could not be read as CSV.
15 #[error(transparent)]
16 CSVError(#[from] csv::Error),
17
18 /// I/O error while opening or reading a file.
19 #[error(transparent)]
20 IOError(#[from] std::io::Error),
21
22 /// Any other errors that are too trivial to be put here explicitly.
23 #[error(transparent)]
24 Other(#[from] anyhow::Error),
25}