flake_edit/
error.rs

1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum FlakeEditError {
5    #[error("IoError: {0}")]
6    Io(#[from] std::io::Error),
7    #[error("The flake should be a root.")]
8    NotARoot,
9    #[error("There is an error in the Lockfile: {0}")]
10    LockError(String),
11    #[error("Deserialization Error: {0}")]
12    Serde(#[from] serde_json::Error),
13    #[error(
14        "Input '{0}' already exists in the flake.\n\nTo replace it:\n  1. Remove it first: flake-edit remove {0}\n  2. Then add it again: flake-edit add {0} <flakeref>\n\nOr add it with a different [ID]:\n  flake-edit add [ID] <flakeref>\n\nTo see all current inputs: flake-edit list"
15    )]
16    DuplicateInput(String),
17}