gaze_recognizers/
error.rs1#[derive(Debug, thiserror::Error)]
3#[non_exhaustive]
4pub enum RecognizerError {
5 #[error("invalid regex: {0}")]
7 InvalidRegex(#[source] regex::Error),
8 #[error("unsupported validator: {kind}")]
10 UnsupportedValidator {
11 kind: String,
13 },
14 #[error("unsupported normalizer: {kind}")]
16 UnsupportedNormalizer {
17 kind: String,
19 },
20}
21
22pub type Result<T> = std::result::Result<T, RecognizerError>;
24
25impl From<gaze_types::ValidatorKindParseError> for RecognizerError {
26 fn from(value: gaze_types::ValidatorKindParseError) -> Self {
27 match value {
28 gaze_types::ValidatorKindParseError::UnsupportedValidator { kind } => {
29 RecognizerError::UnsupportedValidator { kind }
30 }
31 _ => RecognizerError::UnsupportedValidator {
32 kind: value.to_string(),
33 },
34 }
35 }
36}