Skip to main content

lingora_cli/
error.rs

1use lingora_core::prelude::LingoraError;
2use thiserror::Error;
3
4/// Main error type for the `lingora-cli` binary.
5#[derive(Debug, Error)]
6pub enum CliError {
7    /// Any error that originated from `lingora-core`.
8    #[error(transparent)]
9    Lingora(#[from] LingoraError),
10
11    /// Low-level I/O error (e.g. cannot read `Lingora.toml`, cannot write output,
12    /// permission denied, disk full).
13    #[error(transparent)]
14    Io(#[from] std::io::Error),
15
16    /// A path provided or discovered (e.g. config file, output destination)
17    #[error("File {0} has no parent")]
18    NoParent(String),
19
20    /// The audit completed successfully (in the sense there werw no fatal errors),
21    /// but **issues were found** (missing translations, redundant keys, macro mismatches,
22    /// etc.).
23    ///
24    /// This variant is used to signal a non-zero exit code in CI/pre-commit hooks
25    /// while still allowing structured output to be printed.
26    ///
27    /// It is **not** an error in the traditional sense, but an outcome
28    /// indicating "localization is not perfect".
29    #[error("Integrity errors detected")]
30    IntegrityErrorsDetected,
31}