1use std::path::PathBuf;
4
5use crate::BundlePathError;
6
7#[derive(Debug, thiserror::Error)]
14pub enum BundleError {
15 #[error("failed to resolve bundle root {}: {source}", path.display())]
16 Root {
17 path: PathBuf,
18 #[source]
19 source: std::io::Error,
20 },
21 #[error("bundle root is not a directory: {0}")]
22 NotDirectory(PathBuf),
23 #[error("bundle target already exists: {0}")]
24 TargetExists(PathBuf),
25 #[error("failed to read bundle manifest {}: {source}", path.display())]
26 ReadManifest {
27 path: PathBuf,
28 #[source]
29 source: std::io::Error,
30 },
31 #[error("bundle manifest is not a readable phoxal document: {0}")]
32 ManifestJson(#[from] serde_json::Error),
33 #[error("bundle contains unsupported filesystem entry {path}")]
34 UnsupportedEntry { path: PathBuf },
35 #[error("bundle executable is not executable: {path}")]
36 NotExecutable { path: PathBuf },
37 #[error("bundle is missing required file {path}")]
38 MissingFile { path: PathBuf },
39 #[error("failed to read bundle file {path}: {source}", path = path.display())]
40 ReadFile {
41 path: PathBuf,
42 #[source]
43 source: std::io::Error,
44 },
45 #[error(transparent)]
46 Path(#[from] BundlePathError),
47}