From 0dfb6a8ba8bed9f1baf9407f29422744fe127845 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Nerma?= Date: Wed, 6 Dec 2023 16:13:14 +0100 Subject: [PATCH 1/2] Make `ReedlineErrorVariants` public --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index ec31a401..24eeaae1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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"))] From f4c4b220acaa8cb47e585595abd63f9bff49ee8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Nerma?= Date: Wed, 6 Dec 2023 16:30:59 +0100 Subject: [PATCH 2/2] Fix: add missing comments --- src/result.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/result.rs b/src/result.rs index a0691472..e4c7344b 100644 --- a/src/result.rs +++ b/src/result.rs @@ -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), }