1use thiserror::Error;
3
4#[derive(Debug, Error)]
5pub enum WorldInfoError {
6 #[error("Parser error: {0}")]
7 ParserError(ParserError),
8 #[error("Processor error: {0}")]
9 ProcessorError(String),
10 #[error("Evaluation error: {0}")]
11 EvaluationError(String),
12}
13
14#[derive(Error, Debug)]
16pub enum ParserError {
17 #[error("Parsing error: {0}")]
19 PestParse(#[from] pest::error::Error<Rule>),
20
21 #[error("JSON processing error: {0}")]
23 Json(#[from] serde_json::Error),
24
25 #[error("Processor '{0}' not found or failed to instantiate: {1}")]
27 ProcessorInstantiation(String, String), #[error("Invalid parsing rule encountered: {0:?}")]
31 InvalidRule(Rule),
32
33 #[error("Processor execution failed: {0}")]
36 ProcessorExecution(String), #[error("Trigger tag missing 'id' attribute: {0}")]
40 MissingTriggerId(String),
41
42 #[error("Processing error: {0}")]
44 Processing(String),
45}
46
47use crate::parser::Rule;