pub struct Error {
pub kind: ErrorKind,
pub path: Option<String>,
pub source_location: Option<SourceLocation>,
pub help: Option<String>,
pub cause: Option<String>,
}Expand description
Main error type for holoconf operations
Fields§
§kind: ErrorKindThe kind of error that occurred
path: Option<String>Path in the config where the error occurred (e.g., “database.port”)
source_location: Option<SourceLocation>Source location (file, line) if available
help: Option<String>Actionable help message
cause: Option<String>Underlying cause (as string for Clone compatibility)
Implementations§
Source§impl Error
impl Error
Sourcepub fn path_not_found(path: impl Into<String>) -> Self
pub fn path_not_found(path: impl Into<String>) -> Self
Create a path not found error
Sourcepub fn circular_reference(path: impl Into<String>, chain: Vec<String>) -> Self
pub fn circular_reference(path: impl Into<String>, chain: Vec<String>) -> Self
Create a circular reference error
Sourcepub fn env_not_found(
var_name: impl Into<String>,
config_path: Option<String>,
) -> Self
pub fn env_not_found( var_name: impl Into<String>, config_path: Option<String>, ) -> Self
Create an env var not found error
Sourcepub fn ref_not_found(
ref_path: impl Into<String>,
config_path: Option<String>,
) -> Self
pub fn ref_not_found( ref_path: impl Into<String>, config_path: Option<String>, ) -> Self
Create a reference not found error
Sourcepub fn file_not_found(
file_path: impl Into<String>,
config_path: Option<String>,
) -> Self
pub fn file_not_found( file_path: impl Into<String>, config_path: Option<String>, ) -> Self
Create a file not found error
Sourcepub fn unknown_resolver(
name: impl Into<String>,
config_path: Option<String>,
) -> Self
pub fn unknown_resolver( name: impl Into<String>, config_path: Option<String>, ) -> Self
Create an unknown resolver error
Sourcepub fn type_coercion(
path: impl Into<String>,
expected: impl Into<String>,
got: impl Into<String>,
) -> Self
pub fn type_coercion( path: impl Into<String>, expected: impl Into<String>, got: impl Into<String>, ) -> Self
Create a type coercion error
Sourcepub fn validation(path: impl Into<String>, message: impl Into<String>) -> Self
pub fn validation(path: impl Into<String>, message: impl Into<String>) -> Self
Create a validation error
Sourcepub fn with_source_location(self, loc: SourceLocation) -> Self
pub fn with_source_location(self, loc: SourceLocation) -> Self
Add source location to the error
Trait Implementations§
Source§impl Error for Error
impl Error for Error
1.30.0 · 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()
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.