#[non_exhaustive]pub enum Error {
Show 19 variants
Flake(Error),
Config(ConfigError),
Io(Error),
FlakeNotFound {
path: PathBuf,
source: Error,
},
FlakeDirEmpty {
path: PathBuf,
},
IncompatibleFollowOptions,
NoUri,
NoId,
NoInputs,
InvalidUri {
uri: String,
source: NixUriError,
},
InvalidInputId {
id: String,
source: AttrPathParseError,
},
InvalidFollowsPath {
path: String,
source: AttrPathParseError,
},
CouldNotInferId {
uri: String,
},
InputNotPinnable {
id: String,
},
CouldNotRemove {
id: ChangeId,
},
LockFile {
path: PathBuf,
source: Error,
},
FollowsCreateFailed {
id: String,
},
ValidationAfterEdit(Vec<ValidationError>),
Batch {
failures: Vec<(PathBuf, Box<Error>)>,
},
}Expand description
Errors raised inside the binary’s command and handler layer.
One layer combining the per-subcommand operations and the top-level dispatcher.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Flake(Error)
A failure inside the library edit / walk / lock layer.
Config(ConfigError)
A configuration loading failure.
Io(Error)
An io error not otherwise classified (e.g. nix subprocess failure).
FlakeNotFound
flake.nix could not be opened or located.
FlakeDirEmpty
The directory passed to --flake exists but contains no flake.nix.
IncompatibleFollowOptions
--flake and --lock were combined with the batch
follow [PATHS...] form, which owns its own per-file editor.
NoUri
A subcommand was invoked without a URI argument when one is required.
NoId
A subcommand was invoked without an input id when one is required.
NoInputs
An input list was empty when at least one was required.
InvalidUri
A flake reference could not be parsed by nix_uri.
InvalidInputId
An input id was malformed; carries the typed parse error.
InvalidFollowsPath
A follows path was malformed; carries the typed parse error.
CouldNotInferId
nix_uri rendered a flake reference but could not infer an id from it.
InputNotPinnable
The named input has no concrete URL to pin against (e.g. a
follows-only input or a non-standard reference shape).
CouldNotRemove
Removing an input did not produce a syntax change.
LockFile
Could not load flake.lock. The wrapped library error already
classifies the underlying failure.
FollowsCreateFailed
A follow <input> <target> invocation could not establish the
follows relationship.
ValidationAfterEdit(Vec<ValidationError>)
Validation of flake.nix failed after applying speculative edits.
Distinct from crate::Error::Validation (which fires before edits)
because the diagnostic flow needs to render the staged edits too.
Batch
Aggregated failures from a follow [PATHS...] batch. Each entry
pairs the offending path with the error processing it produced.
Implementations§
Source§impl Error
impl Error
Sourcepub fn batch_bullets(&self) -> Option<Vec<String>>
pub fn batch_bullets(&self) -> Option<Vec<String>>
Per-failure rendering of a Batch aggregate. Each item joins the
path with the error and its full source chain so a reader sees the
underlying cause without the renderer descending per-bullet.
Sourcepub fn validation_bullets(&self) -> Option<Vec<String>>
pub fn validation_bullets(&self) -> Option<Vec<String>>
Per-error rendering of a ValidationAfterEdit aggregate. Returns
None for non-aggregate variants.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Source§impl From<ConfigError> for Error
impl From<ConfigError> for Error
Source§fn from(source: ConfigError) -> Self
fn from(source: ConfigError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin 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
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> 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 moreSource§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more