use std::path::PathBuf;
#[derive(thiserror::Error, Debug)]
pub enum Error {
#[error(
"Can not create a Wick package from directory '{0}'. Please specify a component or application file instead."
)]
Directory(PathBuf),
#[error("Can not create a Wick package from {0}. Please specify a component or application file instead.")]
InvalidWickConfig(String),
#[error("Can not create package with file outside of parent directory scope {0}.")]
InvalidFileLocation(String),
#[error("Failed to read downloaded package: {0}")]
PackageReadFailed(String),
#[error("Failed to read file '{0}': {1}")]
ReadFile(PathBuf, #[source] std::io::Error),
#[error("Published components must be named")]
NoName,
#[error(transparent)]
Config(#[from] wick_config::Error),
#[error(transparent)]
Oci(#[from] wick_oci_utils::Error),
#[error(transparent)]
AssetReference(#[from] wick_config::AssetError),
#[error("Could not parse {0} as JSON: {1}")]
InvalidJson(&'static str, #[source] serde_json::Error),
}