That makes sense. My own interest would be mostly on handling unchecked 
exception, since I am interested in catching internal JRuby exceptions, which 
are all unchecked (NPE, CCE, etc.).

Peter

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Charles Oliver 
Nutter
Sent: Thursday, April 24, 2008 10:35 AM
To: [email protected]
Subject: Re: [jruby-dev] Including interpreted Ruby frames in Java stack trace

Peter K Chan wrote:
> Charles,
>       I tried out the patch, but there is a small bug: the expression 
> implementationClass.getBaseName() sometimes return null, thus causing a NPE 
> when constructing a StackTraceElement.
> 
>       I am a little confused about the purpose of the patch though. Is it 
> suppose to handle internal JRuby exceptions, such as NPE or CCE? I applied it 
> and it runs fine, but a NPE from AR-JDBC's internal adapter still shows 
> through with no Ruby source file information on the trace.

It currently does not do anything for Java exceptions. The first version 
was an attempt to solve the issue of Ruby exceptions (in the form of 
RailsException) from leaking out into Java with a nearly-useless stack 
trace. By rewriting the stack trace to include Ruby call information, 
you can at least start to hunt down where it's happening.

I started out trying to support rewriting for arbitrary exceptions, but 
it proved impossible for one painful reason: checked exceptions. I could 
easily catch Exception and rewrite its stack trace...but I could not 
then re-throw it. Very frustrating.

The only hope for being able to re-throw a checked exception without 
declaring that I'm throwing it would be to generate non-Java bytecode 
that does the throw for me. But I will give it a try with unchecked 
exceptions and see how it goes.

- Charlie

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email




---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to