jsx_generator/error.rs
1use thiserror::Error;
2
3/// Code generation errors
4#[derive(Error, Debug)]
5pub enum GeneratorError {
6 #[error("Invalid token: {0}")]
7 InvalidToken(String),
8
9 #[error("Formatting error: {0}")]
10 FormattingError(String),
11
12 #[error("Code generation failed: {0}")]
13 CodeGenerationFailed(String),
14
15 #[error("Unsupported construct: {0}")]
16 UnsupportedConstruct(String),
17
18 #[error("Invalid configuration: {0}")]
19 InvalidConfig(String),
20}
21
22/// Result type for generator operations
23pub type GeneratorResult<T> = Result<T, GeneratorError>;