fob_gen/
error.rs

1//! Error types for JavaScript code generation
2
3use thiserror::Error;
4
5/// Errors that can occur during JavaScript code generation
6#[derive(Error, Debug)]
7pub enum GenError {
8    /// Invalid identifier name
9    #[error("Invalid identifier: {0}")]
10    InvalidIdentifier(String),
11
12    /// Code generation failed
13    #[error("Codegen failed: {0}")]
14    CodegenFailed(String),
15
16    /// Invalid AST structure
17    #[error("Invalid AST structure: {0}")]
18    InvalidAst(String),
19}
20
21/// Result type for code generation operations
22pub type Result<T> = std::result::Result<T, GenError>;