Subj : Re: Rhino: Accessing embedded exception in JavaException To : Lewis Gardner From : Igor Bukanov Date : Tue Apr 20 2004 12:35 pm Lewis Gardner wrote: > Hi, > when I call a Java method via LiveConnect (Rhino) and the method > throws an exception the type of the exception thrown in > "JavaException". Is there any way I can access the original exception, > the one actually thrown by the Java method? I would suggest to upgrade to Rhino 1.5R5 which consistently rethrows exceptions from Java methods as org.mozilla.javascript.WrappedException where the method getWrappedException() returns the original exception object. Prior 1.5R5 Rhino could throw either org.mozilla.javascript.WrappedException or org.mozilla.javascript.JavaScriptException and in the later case to get the original object you have to call getValue() method there, check if it is an instance of Throwable and in addition if that was an instance of WrappedException, then call getWrappedException() to get the real exception source. In Rhino 1.5R5 JavaScriptException represents only exceptions thrown by scripts with JavaScript "throw" statement. Regards, Igor .