pub enum CapsulaError {
Io {
path: Option<PathBuf>,
source: Error,
},
Serialization(Error),
Configuration {
message: String,
},
ContextFailed {
context: String,
message: String,
source: Box<dyn Error + Send + Sync>,
},
Other(String),
}Expand description
Core error type for the Capsula library
This enum defines common infrastructure errors. Context-specific errors should be defined in their respective crates and converted to CoreError via the ContextFailed variant.
Variants§
Io
I/O operation failed
Serialization(Error)
Serialization/deserialization failed
Configuration
Configuration-related error
ContextFailed
Context execution failed This variant wraps context-specific errors while preserving the error chain
Other(String)
Generic error for unexpected conditions
Implementations§
Source§impl CapsulaError
Helper to create I/O errors with path context
impl CapsulaError
Helper to create I/O errors with path context
pub fn io_with_path(path: impl Into<PathBuf>, source: Error) -> Self
Trait Implementations§
Source§impl Debug for CapsulaError
impl Debug for CapsulaError
Source§impl Display for CapsulaError
impl Display for CapsulaError
Source§impl Error for CapsulaError
impl Error for CapsulaError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<Error> for CapsulaError
impl From<Error> for CapsulaError
Auto Trait Implementations§
impl Freeze for CapsulaError
impl !RefUnwindSafe for CapsulaError
impl Send for CapsulaError
impl Sync for CapsulaError
impl Unpin for CapsulaError
impl !UnwindSafe for CapsulaError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more