Don't wrap system errors from function calls.

This commit is contained in:
Stephen Chung
2020-10-28 14:10:46 +08:00
parent 30e11f137b
commit 427af14f1b
5 changed files with 36 additions and 11 deletions

View File

@@ -409,6 +409,9 @@ impl Engine {
)
.into()
}
// System errors are passed straight-through
err if err.is_system_exception() => Err(Box::new(err)),
// Other errors are wrapped in `ErrorInFunctionCall`
_ => EvalAltResult::ErrorInFunctionCall(
fn_def.name.to_string(),
err,