use crate::cargo_manifest::ManifestError;
use marine_module_info_parser::ModuleInfoError;
use marine_it_generator::ITGeneratorError;
use marine_it_parser::ITParserError;
use thiserror::Error as ThisError;
use std::path::PathBuf;
#[derive(Debug, ThisError)]
pub enum CLIError {
#[error("{0} is an unknown command")]
NoSuchCommand(String),
#[error(transparent)]
VersionEmbeddingError(#[from] ModuleInfoError),
#[error(transparent)]
ITGeneratorError(#[from] ITGeneratorError),
#[error(transparent)]
ITParserError(#[from] ITParserError),
#[error("{0}")]
WasmCompilationError(String),
#[error("{0:?}")]
IOError(#[from] std::io::Error),
#[error(transparent)]
ManifestError(#[from] ManifestError),
#[error("Error loading lockfile at {0}: {1}")]
LockfileError(PathBuf, cargo_lock::Error),
#[error(transparent)]
MetadataError(#[from] cargo_metadata::Error),
}