pub enum Error {
UnitNotFound {
id: String,
},
InvalidId {
id: String,
reason: String,
},
CycleDetected {
details: String,
},
VerifyFailed {
reason: String,
},
ConfigError(String),
IndexError(String),
LockConflict(String),
ParseError {
path: PathBuf,
reason: String,
},
IoError(Error),
Internal(Error),
}Expand description
Typed error for mana-core’s public API surface.
Callers can match on variants to handle specific failure modes
(e.g., distinguishing “unit not found” from “file corrupt”).
Internal functions still use anyhow — this type lives at the API boundary.
Variants§
UnitNotFound
The requested unit ID does not exist.
InvalidId
The unit ID is syntactically invalid (empty, special chars, path traversal).
CycleDetected
Adding a dependency would create a cycle in the graph.
VerifyFailed
The verify command failed or timed out.
ConfigError(String)
Problem reading or validating config.yaml.
IndexError(String)
Problem building, loading, or saving the index.
LockConflict(String)
Could not acquire the index lock (another process may hold it).
ParseError
YAML/frontmatter deserialization failed.
IoError(Error)
Filesystem I/O failure.
Internal(Error)
Catch-all for internal errors that don’t fit a specific variant.
Preserves the original anyhow::Error for debugging.
Trait Implementations§
Source§impl Error for ManaError
impl Error for ManaError
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()
Auto Trait Implementations§
impl Freeze for ManaError
impl !RefUnwindSafe for ManaError
impl Send for ManaError
impl Sync for ManaError
impl Unpin for ManaError
impl UnsafeUnpin for ManaError
impl !UnwindSafe for ManaError
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more