muster/adapter/cli/
error.rs1use thiserror::Error;
2
3use crate::domain::config::ConfigError;
4
5#[derive(Debug, Error)]
7pub enum CliError {
8 #[error("unknown project '{0}'")]
10 UnknownProject(String),
11 #[error("'{0}' is not a valid process name")]
13 InvalidName(String),
14 #[error("the command is empty")]
16 EmptyCommand,
17 #[error("the command cannot be represented as a shell command")]
19 InvalidCommand,
20 #[error("muster run is only supported on Unix")]
22 Unsupported,
23 #[error(transparent)]
25 Config(#[from] ConfigError),
26 #[error("failed to run the command: {0}")]
28 Exec(#[source] std::io::Error),
29 #[error("'{0}' contains non-UTF-8 components and cannot be registered")]
31 UnrepresentablePath(std::path::PathBuf),
32 #[error("cannot derive a project name from '{0}'")]
34 InvalidProjectFolder(std::path::PathBuf),
35 #[error("{0} not found; run `muster init` there first")]
37 MissingWorkspaceFile(std::path::PathBuf),
38 #[error("unknown project '{name}'; registered: {known}")]
40 UnknownProjectAmong { name: String, known: String },
41 #[error("'{name}' matches {count} projects; remove is ambiguous. Registered paths: {paths}")]
43 AmbiguousProject {
44 name: String,
46 count: usize,
48 paths: String,
50 },
51}