Skip to main content

Module error

Module error 

Source
Expand description

Error types for Hypen Engine operations.

Provides structured errors that SDK authors can pattern-match on, replacing the previous Result<_, String> API.

§Example

use hypen_engine::EngineError;

fn handle_error(err: EngineError) {
    match err {
        EngineError::ParseError { source, message } => {
            eprintln!("Failed to parse '{}': {}", source, message);
        }
        EngineError::ComponentNotFound(name) => {
            eprintln!("Component '{}' not found", name);
        }
        EngineError::ActionNotFound(name) => {
            eprintln!("No handler for action '{}'", name);
        }
        EngineError::RenderError(msg) => {
            eprintln!("Render failed: {}", msg);
        }
        EngineError::StateError(msg) => {
            eprintln!("State error: {}", msg);
        }
        EngineError::ExpressionError(msg) => {
            eprintln!("Expression error: {}", msg);
        }
    }
}

Enums§

EngineError
Structured error type for Hypen Engine operations.