Re: [jruby-dev] Catchable Java RuntimeExceptions

2008-04-24 Thread Charles Oliver Nutter
MenTaLguY wrote: How about only doing the capture and conversion of Java exceptions when compiling/interpreting a begin...rescue block with a clause that traps NativeExceptions? You don't need to do the conversion all the time (and in fact the performance hit from the conversion sounds very unap

Re: [jruby-dev] Catchable Java RuntimeExceptions

2008-04-24 Thread MenTaLguY
On Thu, 24 Apr 2008 13:26:59 -0700, MenTaLguY <[EMAIL PROTECTED]> wrote: > On Thu, 24 Apr 2008 12:35:50 -0700, MenTaLguY <[EMAIL PROTECTED]> wrote: >> How about only doing the capture and conversion of Java exceptions when >> compiling/interpreting a begin...rescue block with a clause that traps >>

Re: [jruby-dev] Catchable Java RuntimeExceptions

2008-04-24 Thread Charles Oliver Nutter
MenTaLguY wrote: How about only doing the capture and conversion of Java exceptions when compiling/interpreting a begin...rescue block with a clause that traps NativeExceptions? You don't need to do the conversion all the time (and in fact the performance hit from the conversion sounds very unap

Re: [jruby-dev] Catchable Java RuntimeExceptions

2008-04-24 Thread MenTaLguY
On Thu, 24 Apr 2008 12:35:50 -0700, MenTaLguY <[EMAIL PROTECTED]> wrote: > How about only doing the capture and conversion of Java exceptions when > compiling/interpreting a begin...rescue block with a clause that traps > NativeExceptions? Argh, forgot that the exception class can be an arbitrary

Re: [jruby-dev] Catchable Java RuntimeExceptions

2008-04-24 Thread MenTaLguY
How about only doing the capture and conversion of Java exceptions when compiling/interpreting a begin...rescue block with a clause that traps NativeExceptions? You don't need to do the conversion all the time (and in fact the performance hit from the conversion sounds very unappealing) if you're

[jruby-dev] Catchable Java RuntimeExceptions

2008-04-24 Thread Charles Oliver Nutter
Attached is a patch to DefaultMethod that attempts to wrap all RuntimeException instances passing through it with a Ruby NativeException, allowing you to catch them as normal. Consider it an experimental start. There are caveats: - Since the script you specify on the command line immediately