Better handling of errors during function calls.

This commit is contained in:
Stephen Chung
2020-05-13 21:58:38 +08:00
parent 9d8d074940
commit cabceb7498
12 changed files with 97 additions and 75 deletions

View File

@@ -124,8 +124,9 @@ fn call_fn(
global_module
.get_fn(hash)
.or_else(|| packages.get_fn(hash))
.map(|func| func.call(args, pos))
.map(|func| func.call(args))
.transpose()
.map_err(|err| err.new_position(pos))
}
/// Optimize a statement.