nix_compat/derivation/
errors.rs1use crate::store_path;
3use thiserror::Error;
4
5use super::CAHash;
6
7#[derive(Debug, Error, PartialEq)]
9pub enum DerivationError {
10 #[error("no outputs defined")]
12 NoOutputs(),
13 #[error("invalid output name: {0}")]
14 InvalidOutputName(String),
15 #[error("encountered fixed-output derivation, but more than 1 output in total")]
16 MoreThanOneOutputButFixed(),
17 #[error("invalid output name for fixed-output derivation: {0}")]
18 InvalidOutputNameForFixed(String),
19 #[error("unable to validate output {0}: {1}")]
20 InvalidOutput(String, OutputError),
21 #[error("unable to validate output {0}: {1}")]
22 InvalidOutputDerivationPath(String, store_path::BuildStorePathError),
23 #[error("unable to parse input derivation path {0}: {1}")]
25 InvalidInputDerivationPath(String, store_path::Error),
26 #[error("input derivation {0} doesn't end with .drv")]
27 InvalidInputDerivationPrefix(String),
28 #[error("input derivation {0} output names are empty")]
29 EmptyInputDerivationOutputNames(String),
30 #[error("input derivation {0} output name {1} is invalid")]
31 InvalidInputDerivationOutputName(String, String),
32
33 #[error("unable to parse input sources path {0}: {1}")]
35 InvalidInputSourcesPath(String, store_path::Error),
36
37 #[error("invalid platform field: {0}")]
39 InvalidPlatform(String),
40
41 #[error("invalid builder field: {0}")]
43 InvalidBuilder(String),
44
45 #[error("invalid environment key {0}")]
47 InvalidEnvironmentKey(String),
48}
49
50#[derive(Debug, Error, PartialEq)]
53pub enum OutputError {
54 #[error("Invalid output path {0}: {1}")]
55 InvalidOutputPath(String, store_path::Error),
56 #[error("Missing output path")]
57 MissingOutputPath,
58 #[error("Invalid CAHash: {:?}", .0)]
59 InvalidCAHash(CAHash),
60}