[Ironruby-core] Handling runtime errors in embedded applications

Jim Deville jdeville at microsoft.com
Sat Jan 2 01:02:03 EST 2010


Odd.... I've used the e.Handled argument before too...

JD

-----Original Message-----
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of James Leskovar
Sent: Friday, January 01, 2010 1:52 PM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] Handling runtime errors in embedded applications

Hmm, UnhandledExceptionEventArgs seems to only have two properties,
ExceptionObject and IsTerminating, both of which are read-only. After a
bit of investigation, there is another type of unhandled-exception
handler, set with Application.ThreadException, which can prevent
application termination. However, it only catches exceptions in Windows
Forms threads, so it's not applicable for DLR exceptions (indeed, the
event is not fired when an IR exception occurs.)

James

Jimmy Schementi wrote:
> UnhandledException *does* have the feature to not terminate the process; 
> you need to do "e.Handled = true;" in your exception handler to tell the 
> CLR that the exception has been properly handled. If you don't set it, 
> the CLR doesn't see the exception as handled and continues propagating 
> the exception, which will eventually terminate the process.
> 
> I was pretty sure it worked for Threads as well, since all threads are 
> still bound to the current AppDomain, but let me know if your fixed 
> exception handler still doesn't solve this. However, your work-around 
> will work in the meantime.
> 
> ~js
-- 
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ironruby-core mailing list
Ironruby-core at rubyforge.org
http://rubyforge.org/mailman/listinfo/ironruby-core



More information about the Ironruby-core mailing list