1use thiserror::Error;
2
3#[derive(Debug, Error)]
5pub enum MatcherError {
6 #[error("match query is empty or whitespace-only")]
8 EmptyQuery,
9
10 #[error("invalid Kitsu dump path: {0}")]
12 InvalidDumpPath(String),
13
14 #[error("invalid Kitsu dump format: {0}")]
16 InvalidDump(String),
17
18 #[error("HTTP request failed: {0}")]
20 Http(#[from] reqwest::Error),
21
22 #[error("I/O error: {0}")]
24 Io(#[from] std::io::Error),
25
26 #[error("remote GraphQL error: {0}")]
28 GraphQl(String),
29
30 #[error("invalid remote response: {0}")]
32 InvalidResponse(String),
33}
34
35pub type MatchResult<T> = std::result::Result<T, MatcherError>;