-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
100 additions
and
63 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
use thiserror::Error; | ||
|
||
pub type CsvlensResult<T> = std::result::Result<T, CsvlensError>; | ||
|
||
/// Errors csvlens can have | ||
#[derive(Debug, Error)] | ||
pub enum CsvlensError { | ||
#[error("Failed to read file: {0}")] | ||
FileReadError(String), | ||
|
||
#[error("Column name not found: {0}")] | ||
ColumnNameNotFound(String), | ||
|
||
#[error("Delimiter should not be empty")] | ||
DelimiterEmptyError, | ||
|
||
#[error("Delimiter should be within the ASCII range: {0} is too fancy")] | ||
DelimiterNotAsciiError(char), | ||
|
||
#[error("Delimiter should be exactly one character (or \\t), got '{0}'")] | ||
DelimiterMultipleCharactersError(String), | ||
|
||
#[error(transparent)] | ||
DelimiterParseError(#[from] std::char::TryFromCharError), | ||
|
||
#[error(transparent)] | ||
CsvError(#[from] csv::Error), | ||
|
||
#[error(transparent)] | ||
Io(#[from] std::io::Error), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ mod app; | |
mod common; | ||
mod csv; | ||
mod delimiter; | ||
pub mod errors; | ||
mod find; | ||
mod help; | ||
mod history; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.