Skip to content

Instantly share code, notes, and snippets.

@LeifWarner
Created April 4, 2012 22:34
Show Gist options
  • Save LeifWarner/2306177 to your computer and use it in GitHub Desktop.
Save LeifWarner/2306177 to your computer and use it in GitHub Desktop.
require 'java'
java_import "foo.Crash"
c = Crash.new
c.foo
package foo
class Crash {
def foo =
try
err
catch {
case e:Exception =>
e.printStackTrace
}
def err = error("ouch")
}
java.lang.RuntimeException: ouch
at scala.sys.package$.error(package.scala:27)
at scala.Predef$.error(Predef.scala:66)
at foo.Crash.err(Crash.scala:13)
at foo.Crash.foo(Crash.scala:6)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:508)
at org.jruby.javasupport.JavaMethod.invokeDirect(JavaMethod.java:368)
at org.jruby.java.invokers.InstanceMethodInvoker.call(InstanceMethodInvoker.java:50)
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:292)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:135)
at crash.__file__(crash.rb:5)
at crash.load(crash.rb)
at org.jruby.Ruby.runScript(Ruby.java:697)
at org.jruby.Ruby.runScript(Ruby.java:690)
at org.jruby.Ruby.runNormally(Ruby.java:597)
at org.jruby.Ruby.runFromMain(Ruby.java:446)
at org.jruby.Main.doRunFromMain(Main.java:369)
at org.jruby.Main.internalRun(Main.java:258)
at org.jruby.Main.run(Main.java:224)
at org.jruby.Main.run(Main.java:208)
at org.jruby.Main.main(Main.java:188
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment