shulkerscript_cli/
error.rs

1use std::path::PathBuf;
2
3#[allow(clippy::enum_variant_names)]
4#[derive(thiserror::Error, Debug)]
5pub enum Error {
6    #[error("No file/directory found at path {0}.")]
7    PathNotFoundError(PathBuf),
8    #[error("An error occured because the directory {0} is not empty.")]
9    NonEmptyDirectoryError(PathBuf),
10    #[error("An error occured because the path {0} is not a directory.")]
11    NotDirectoryError(PathBuf),
12    #[error("An error occured because the path is neither a pack directory or a pack.toml file.")]
13    InvalidPackPathError(PathBuf),
14    #[error("An error occured because the feature {0} is not enabled.")]
15    FeatureNotEnabledError(String),
16    #[error("An error occured because the pack version does not support a used feature")]
17    IncompatiblePackVersionError,
18}
19
20#[allow(dead_code)]
21pub type Result<T> = std::result::Result<T, Error>;