On Thu, Apr 8, 2010 at 11:37 AM, Joseph Athman <[email protected]> wrote:
> Can I be a devil's advocate for not "fixing" the JRUBY-4677.  Wouldn't this
> just be fixing a symptom and not the real problem?  Isn't the real problem
> that the ActiveRecord JDBC adapter is throwing native Java exceptions
> instead of Ruby exceptions?  It just seems scary to me that having rescue
> Exception also catch Java exceptions could lead to some poorly crafted JRuby
> only code.  Where developers are relying on this hidden/magic behavior.  If
> I write a library specifically for JRuby and I want my Ruby code to catch a
> Java exception I think I should be required to specifically code for this.
> But in the generally case "rescue Exception" should only do what it says.
> It should just catch Ruby exceptions.

Well I might agree, except that if "rescue Exception" doesn't rescue
everything, there's no way for Ruby code to portable "catch all".
There's also no way of preventing all Java exceptions from happening,
since things like stack errors and memory errors can happen any time.
Even us adding a "catch Throwable" plus wrapping as a Ruby
NativeException wouldn't cover all cases (and it would clutter up the
call path with lots and lots of exception-handling logic).

- Charlie

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

    http://xircles.codehaus.org/manage_email


Reply via email to