wick_asset_reference/
error.rs1use std::path::PathBuf;
2
3use thiserror::Error;
4
5#[derive(Error, Debug, Clone, PartialEq)]
7#[non_exhaustive]
8pub enum Error {
9 #[error("Could not parse {0} as a URL or reference")]
11 BadUrl(String),
12
13 #[error("Could not read file {}", .0.display())]
15 LoadError(PathBuf),
16
17 #[error("Asset {} wasn't found locally and couldn't be pulled: {1}", .0.display())]
19 PullFailed(PathBuf, String),
20
21 #[error("Normalization failed for path '{0}': {1}")]
23 NormalizationFailure(String, String),
24
25 #[error("File or directory {} not found", .0.display())]
27 NotFound(PathBuf),
28
29 #[error("Could not resolve {0} to a filesystem location or an OCI reference")]
31 Unresolvable(String),
32
33 #[error("File {} does not reside in target directory {1}", .0.display())]
35 FileEscapesRoot(PathBuf, String),
36}