promise runtime err

This commit is contained in:
Jaroslaw Konik 2025-05-15 07:00:00 +02:00
parent 2a05b9a50d
commit bd4b377fc6
2 changed files with 4 additions and 2 deletions

View file

@ -1,5 +1,5 @@
def test_func def test_func
rust_func.and_then lambda { |x| rust_func.and_then lambda { |x|
$state['x'] = x print('abc' + 5)
} }
end end

View file

@ -368,7 +368,9 @@ impl Runtime for RubyRuntime {
.into_iter() .into_iter()
.map(|x| ruby.get_inner(x.0).as_value()) .map(|x| ruby.get_inner(x.0).as_value())
.collect(); .collect();
let result: magnus::Value = f.funcall("call", args.as_slice()).unwrap(); let result: magnus::Value = f.funcall("call", args.as_slice()).map_err(|e| {
ScriptingError::RuntimeError(Box::new(io::Error::other(e.to_string())))
})?;
Ok(RubyValue::new(result)) Ok(RubyValue::new(result))
})) }))
} }