Saturday, March 26, 2005

Don't throw from finally

I found this very interesting. It's a .NET piece, but these things tend to cross over one-to-one into Java fairly often. This is a CLR feature, so dunno in this case if the JVM behavs the same way.

Btw, both in C++ and C# you have the option of setting an event handler for an unexpected exception.

In C++,
set_unexpected( my_event_handler );

In C#,
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler( MyEventHandler );

Is there something similar in Java?

No comments: