pub enum CoreError {
Config(String),
PathResolution(String),
Io(Error),
}Expand description
Re-export of CoreError — the unified error type for dscode-core.
All fallible operations in this crate return Result<T, CoreError>.
The unified error type for all fallible operations in dscode-core.
Every public function in this crate that can fail returns a
Result<T, CoreError>. The variants cover configuration errors,
path resolution failures, and I/O errors from the underlying filesystem.
§Display
Each variant implements std::fmt::Display via thiserror, so calling
.to_string() on a CoreError produces a human-readable message suitable
for logging or displaying to the user.
§Conversion
CoreError implements From<std::io::Error> so I/O errors can be
propagated with the ? operator. It also implements Into<String> for
ergonomic string conversion.
Variants§
Config(String)
A configuration error, such as an invalid setting value or a missing required field in a configuration file.
The contained String describes the specific configuration problem.
PathResolution(String)
A platform-specific directory path could not be resolved.
This typically occurs when the home directory is unavailable or a
user-configured path (e.g. ~ expansion) cannot be expanded.
The contained String describes which path failed and why.
Io(Error)
An I/O error occurred during a file or directory operation.
This variant wraps std::io::Error and is automatically created via
the ? operator on any I/O call that fails (e.g. creating directories,
reading configuration files).
Trait Implementations§
Source§impl Error for CoreError
impl Error for CoreError
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()