added a comment - - edited
My application uses ScriptingContainer from within jruby as a way to sandbox a work routine. During this work, I need to execute code back in the main jruby instance.
require 'java'
sc = org.jruby.embed.ScriptingContainer.new(org.jruby.embed.LocalContextScope::THREADSAFE)
sc.runScriptlet 'def foo(a); a.call end'
a = proc { begin; raise StandardError; rescue; end }
sc.callMethod(sc.runScriptlet("Kernel"), "foo", a)
This generates a
TypeError: assigning non-exception to $!
Is there another way to accomplish this and workaround this issue?
My application uses ScriptingContainer from within jruby as a way to sandbox a work routine. During this work, I need to execute code back in the main jruby instance.
This generates a
TypeError: assigning non-exception to $!
Is there another way to accomplish this and workaround this issue?