use std::path::PathBuf;
#[derive(Debug, thiserror::Error)]
pub(crate) enum ManifestError {
#[error(
"cannot read the message manifest at {path}: {source}\n\
the i18n crate's build script writes it — build that crate, or, if its \
target directory moved, rebuild it there"
)]
Read {
path: PathBuf,
#[source]
source: std::io::Error,
},
#[error("the message manifest at {path} is not readable: {source}")]
Invalid {
path: PathBuf,
#[source]
source: mf2_catalog::ManifestError,
},
#[error(
"the message manifest at {path} is stale: it hashes to {found:#018x}, but this \
`tr!` was generated for {expected:#018x}\n\
the generated module and the manifest are from different builds — rebuild the \
i18n crate (in an editor: restart the proc-macro server)"
)]
Stale {
path: String,
found: u64,
expected: u64,
},
#[error("the inline manifest is not a byte-string literal: {0}")]
Literal(String),
}