Skip to main content

c2pa_text_binding/
error.rs

1use std::fmt;
2
3#[derive(Debug)]
4pub enum Error {
5    ContentTooShort,
6    GenerationFailed(String),
7    MatchFailed(String),
8}
9
10impl fmt::Display for Error {
11    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
12        match self {
13            Self::ContentTooShort => write!(f, "text content too short for fingerprinting"),
14            Self::GenerationFailed(s) => write!(f, "fingerprint generation failed: {s}"),
15            Self::MatchFailed(s) => write!(f, "fingerprint match failed: {s}"),
16        }
17    }
18}
19
20impl std::error::Error for Error {}