Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ReedlineErrorVariants public #679

Merged
merged 2 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ mod engine;
pub use engine::Reedline;

mod result;
pub use result::{ReedlineError, Result};
pub use result::{ReedlineError, ReedlineErrorVariants, Result};

mod history;
#[cfg(any(feature = "sqlite", feature = "sqlite-dynlib"))]
Expand Down
10 changes: 10 additions & 0 deletions src/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,25 @@ use thiserror::Error;
pub enum ReedlineErrorVariants {
// todo: we should probably be more specific here
#[cfg(any(feature = "sqlite", feature = "sqlite-dynlib"))]
/// Error within history database
#[error("error within history database: {0}")]
HistoryDatabaseError(String),

/// Error within history
#[error("error within history: {0}")]
OtherHistoryError(&'static str),

/// History does not support a feature
#[error("the history {history} does not support feature {feature}")]
HistoryFeatureUnsupported {
/// Custom display name for the history
history: &'static str,

/// Unsupported feature
feature: &'static str,
},

/// I/O error
#[error("I/O error: {0}")]
IOError(std::io::Error),
}
Expand Down