Skip to main content

nix_compat/derivation/
errors.rs

1//! Contains [DerivationError], exported as [crate::derivation::DerivationError]
2use crate::store_path::{self, StorePath};
3use thiserror::Error;
4
5/// Errors that can occur during the validation of Derivation structs.
6#[derive(Debug, Error, PartialEq)]
7#[allow(missing_docs)]
8pub enum DerivationError {
9    #[error("unable to parse derivation name {0}: {1}")]
10    InvalidDerivationName(String, #[source] store_path::ParseStorePathError),
11
12    // outputs
13    #[error("{0}")]
14    InvalidOutputs(
15        #[from]
16        #[source]
17        super::outputs::OutputsError,
18    ),
19    // input derivation
20    #[error("unable to parse input derivation path {0}: {1}")]
21    InvalidInputDerivationPath(String, #[source] store_path::ParseStorePathError),
22    #[error("unable to lookup input derivation {0}")]
23    MissingInputDerivation(StorePath),
24    #[error("input derivation {0} doesn't end with .drv")]
25    InvalidInputDerivationPrefix(String),
26    #[error("input derivation {0} output names are empty")]
27    EmptyInputDerivationOutputNames(String),
28    #[error("input derivation {0} output name {1} is invalid")]
29    InvalidInputDerivationOutputName(String, String),
30
31    // input sources
32    #[error("unable to parse input sources path {0}: {1}")]
33    InvalidInputSourcesPath(String, #[source] store_path::ParseStorePathError),
34
35    // platform
36    #[error("invalid platform field: {0}")]
37    InvalidPlatform(String),
38
39    // builder
40    #[error("invalid builder field: {0}")]
41    InvalidCommand(String),
42
43    // environment
44    #[error("invalid environment key {0}")]
45    InvalidEnvironmentKey(String),
46}