pub enum SourceError {
NotFound(String),
ReadFailed(String),
ParseFailed {
path: String,
format: String,
message: String,
},
InvalidFormat {
expected: String,
found: String,
},
Io(String),
EnvVar(String),
Network(String),
Serialization(String),
InvalidPath(PathBuf),
Unsupported(String),
Validation(String),
Custom(String),
}Expand description
Re-export of cfgmatic-source types for migration convenience. Error type for source operations.
This enum covers all possible errors that can occur during source loading, parsing, and processing.
Variants§
NotFound(String)
Source not found.
ReadFailed(String)
Failed to read source.
ParseFailed
Failed to parse source content.
Fields
InvalidFormat
Invalid format detected.
Io(String)
IO error.
EnvVar(String)
Environment variable error.
Network(String)
Network error for remote sources.
Serialization(String)
Serialization/deserialization error.
InvalidPath(PathBuf)
Invalid source path.
Unsupported(String)
Unsupported operation.
Validation(String)
Source validation failed.
Custom(String)
Custom error.
Implementations§
Source§impl SourceError
impl SourceError
Sourcepub fn not_found(source: &str) -> SourceError
pub fn not_found(source: &str) -> SourceError
Create a not found error.
Sourcepub fn read_failed(source: &str) -> SourceError
pub fn read_failed(source: &str) -> SourceError
Create a read failed error.
Sourcepub fn parse_failed(path: &str, format: &str, message: &str) -> SourceError
pub fn parse_failed(path: &str, format: &str, message: &str) -> SourceError
Create a parse failed error.
Sourcepub fn invalid_format(expected: &str, found: &str) -> SourceError
pub fn invalid_format(expected: &str, found: &str) -> SourceError
Create an invalid format error.
Sourcepub fn io(message: &str) -> SourceError
pub fn io(message: &str) -> SourceError
Create an IO error.
Sourcepub fn env_var(message: &str) -> SourceError
pub fn env_var(message: &str) -> SourceError
Create an environment variable error.
Sourcepub fn network(message: &str) -> SourceError
pub fn network(message: &str) -> SourceError
Create a network error.
Sourcepub fn serialization(message: &str) -> SourceError
pub fn serialization(message: &str) -> SourceError
Create a serialization error.
Sourcepub fn invalid_path(path: PathBuf) -> SourceError
pub fn invalid_path(path: PathBuf) -> SourceError
Create an invalid path error.
Sourcepub fn unsupported(operation: &str) -> SourceError
pub fn unsupported(operation: &str) -> SourceError
Create an unsupported operation error.
Sourcepub fn validation(message: &str) -> SourceError
pub fn validation(message: &str) -> SourceError
Create a validation error.
Sourcepub fn custom(message: &str) -> SourceError
pub fn custom(message: &str) -> SourceError
Create a custom error.
Sourcepub const fn is_not_found(&self) -> bool
pub const fn is_not_found(&self) -> bool
Check if this is a not found error.
Sourcepub const fn is_parse_failed(&self) -> bool
pub const fn is_parse_failed(&self) -> bool
Check if this is a parse error.
Sourcepub const fn is_network(&self) -> bool
pub const fn is_network(&self) -> bool
Check if this is a network error.
Trait Implementations§
Source§impl Debug for SourceError
impl Debug for SourceError
Source§impl Display for SourceError
impl Display for SourceError
Source§impl Error for SourceError
impl Error for SourceError
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
Source§impl From<Error> for SourceError
impl From<Error> for SourceError
Source§fn from(err: Error) -> SourceError
fn from(err: Error) -> SourceError
Source§impl From<Error> for SourceError
Available on crate feature json only.
impl From<Error> for SourceError
json only.