use crate::error::fs::CanonicalizePathError;
use crate::error::get_asset_config::GetAssetConfigError;
use crate::error::load_config::AssetLoadConfigError;
use std::path::PathBuf;
use thiserror::Error;
#[derive(Error, Debug)]
pub enum GatherAssetDescriptorsError {
#[error("Asset with key '{0}' defined at {1} and {2}")]
DuplicateAssetKey(String, Box<PathBuf>, Box<PathBuf>),
#[error("Failed to get asset configuration")]
GetAssetConfigFailed(#[from] GetAssetConfigError),
#[error("invalid directory entry")]
InvalidDirectoryEntry(#[source] CanonicalizePathError),
#[error("invalid source directory")]
InvalidSourceDirectory(#[source] CanonicalizePathError),
#[error("Failed to load asset configuration")]
LoadConfigFailed(#[source] AssetLoadConfigError),
#[error(
"This project uses the hardened security policy for some assets, but does not actually configure any custom improvements over the standard policy. To get started, look at 'dfx info security-policy'. It shows the default security policy along with suggestions on how to improve it.\n{0}"
)]
HardenedSecurityPolicyIsNotHardened(String),
}