mirror of
https://github.com/storytold/cadcraft.git
synced 2026-11-03 00:42:46 -06:00
Merged onto current main: the DWG writer's per-type counts of what it leaves out travel back from the DWG worker, the roundtrip command follows the CLI's clap subcommands, and read_source keeps main's format detection. The docs/gaps.md edit is dropped; maintainers update the parity rows in batches.
33 lines
1.1 KiB
Rust
33 lines
1.1 KiB
Rust
use crate::output::OutputError;
|
|
use crate::perf::PerfError;
|
|
use crate::roundtrip::RoundtripError;
|
|
use crate::run::RunError;
|
|
|
|
/// Why a subcommand failed: printed as `error: {e}`, exit 1.
|
|
#[derive(Debug, thiserror::Error)]
|
|
pub(crate) enum CliError {
|
|
#[error(transparent)]
|
|
Engine(#[from] cadcraft_engine::EngineError),
|
|
#[error(transparent)]
|
|
Doc(#[from] cadcraft_engine::doc::DocError),
|
|
#[error(transparent)]
|
|
Format(#[from] cadcraft_io::IoError),
|
|
#[error(transparent)]
|
|
Io(#[from] std::io::Error),
|
|
#[error(transparent)]
|
|
Run(#[from] RunError),
|
|
#[error(transparent)]
|
|
Output(#[from] OutputError),
|
|
#[error(transparent)]
|
|
Perf(#[from] PerfError),
|
|
#[error(transparent)]
|
|
Roundtrip(#[from] RoundtripError),
|
|
/// The engine and io crates take file names as text.
|
|
#[error("{}: the file name is not valid Unicode", .0.display())]
|
|
NotUnicode(std::path::PathBuf),
|
|
#[error("cannot connect to {addr}: {source}")]
|
|
McpConnect { addr: String, source: std::io::Error },
|
|
}
|
|
|
|
pub(crate) type Result<T = (), E = CliError> = std::result::Result<T, E>;
|