fuzzy_parser/error.rs
1//! Error types for fuzzy parsing
2
3use thiserror::Error;
4
5/// Errors that can occur during fuzzy JSON repair
6#[derive(Debug, Error)]
7pub enum FuzzyError {
8 /// JSON parsing failed
9 #[error("JSON parse error: {0}")]
10 JsonParse(#[from] serde_json::Error),
11
12 /// Expected an object but got something else
13 #[error("Expected JSON object, got different type")]
14 NotObject,
15
16 /// A JSON Schema document could not be converted into a repair schema
17 #[error("JSON Schema import failed: {0}")]
18 SchemaImport(String),
19}