Throw Exception on Error ======================= {{#include ../links.md}} All of [`Engine`]'s evaluation/consuming methods return `Result>` with `EvalAltResult` holding error information. To deliberately return an error during an evaluation, use the `throw` keyword. ```rust if some_bad_condition_has_happened { throw error; // 'throw' any value as the exception } throw; // defaults to '()' ``` Exceptions thrown via `throw` in the script can be captured in Rust by matching `Err(Box)` with the exception value captured by `value`. ```rust let result = engine.eval::(r#" let x = 42; if x > 0 { throw x; } "#); println!(result); // prints "Runtime error: 42 (line 5, position 15)" ```