diff options
Diffstat (limited to 'tvix/nix-compat/src/derivation/parse_error.rs')
-rw-r--r-- | tvix/nix-compat/src/derivation/parse_error.rs | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/tvix/nix-compat/src/derivation/parse_error.rs b/tvix/nix-compat/src/derivation/parse_error.rs index a064d4faba7b..34a9c9fd9204 100644 --- a/tvix/nix-compat/src/derivation/parse_error.rs +++ b/tvix/nix-compat/src/derivation/parse_error.rs @@ -6,15 +6,23 @@ use crate::nixhash; pub type NomResult<I, O> = IResult<I, O, NomError<I>>; -#[derive(Debug, PartialEq)] +#[derive(Debug, thiserror::Error, PartialEq)] pub enum ErrorKind { - // duplicate key in map + /// duplicate key in map + #[error("duplicate map key: {0}")] DuplicateMapKey(String), - // Digest parsing error + /// Input derivation has two outputs with the same name + #[error("duplicate output name {1} for input derivation {0}")] + DuplicateInputDerivationOutputName(String, String), + + #[error("duplicate input source: {0}")] + DuplicateInputSource(String), + + #[error("nix hash error: {0}")] NixHashError(nixhash::Error), - // error kind wrapped from native nom errors + #[error("nom error: {0:?}")] Nom(nom::error::ErrorKind), } |