pub enum LitError {
Encryption(String),
IO(String),
Config(String),
Network(String),
Repository(String),
Object(String),
Index(String),
General(String),
}Expand description
Main error type for Lit operations
Variants§
Encryption(String)
Encryption-related errors (passphrase, key derivation, etc.)
IO(String)
I/O errors (file read/write)
Config(String)
Configuration errors
Network(String)
Network-related errors
Repository(String)
Repository structure errors
Object(String)
Git object errors
Index(String)
Index errors
General(String)
General errors
Implementations§
Source§impl LitError
impl LitError
Sourcepub fn encryption(internal_msg: impl Into<String>) -> Self
pub fn encryption(internal_msg: impl Into<String>) -> Self
Create an encryption error with detailed internal message
Sourcepub fn io(internal_msg: impl Into<String>) -> Self
pub fn io(internal_msg: impl Into<String>) -> Self
Create an I/O error with detailed internal message
Sourcepub fn config(internal_msg: impl Into<String>) -> Self
pub fn config(internal_msg: impl Into<String>) -> Self
Create a config error with detailed internal message
Sourcepub fn network(internal_msg: impl Into<String>) -> Self
pub fn network(internal_msg: impl Into<String>) -> Self
Create a network error with detailed internal message
Sourcepub fn repository(internal_msg: impl Into<String>) -> Self
pub fn repository(internal_msg: impl Into<String>) -> Self
Create a repository error with detailed internal message
Sourcepub fn object(internal_msg: impl Into<String>) -> Self
pub fn object(internal_msg: impl Into<String>) -> Self
Create an object error with detailed internal message
Sourcepub fn index(internal_msg: impl Into<String>) -> Self
pub fn index(internal_msg: impl Into<String>) -> Self
Create an index error with detailed internal message
Sourcepub fn general(internal_msg: impl Into<String>) -> Self
pub fn general(internal_msg: impl Into<String>) -> Self
Create a general error with detailed internal message
Sourcepub fn internal_message(&self) -> &str
pub fn internal_message(&self) -> &str
Get the internal detailed error message (for logging only)
Sourcepub fn error_code(&self) -> &'static str
pub fn error_code(&self) -> &'static str
Machine-readable error code for structured output
Sourcepub fn user_message(&self) -> &str
pub fn user_message(&self) -> &str
User-facing error message (safe to display — strips internal details) SECURITY: Returns category-based messages to prevent information disclosure (FINDING-003)
Sourcepub fn suggestions(&self) -> Vec<&'static str>
pub fn suggestions(&self) -> Vec<&'static str>
Actionable suggestions for agents to resolve the error
Sourcepub fn log_detailed(&self)
pub fn log_detailed(&self)
Log detailed error to secure log file (not stdout/stderr)
Trait Implementations§
Source§impl Display for LitError
Display implementation shows sanitized error messages
SECURITY: Does not expose file paths, internal state, or detailed errors
impl Display for LitError
Display implementation shows sanitized error messages SECURITY: Does not expose file paths, internal state, or detailed errors
Source§impl Error for LitError
impl Error for LitError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()