DCSIMG
Throw Exceptions Responsibly - Dotmad (on .Net)

Dotmad (on .Net)

Just Another Web 5.0 Blog

Podcasts

Blogroll

Throw Exceptions Responsibly

Recently I had to spent some time to fix a crash in the application I'm working on: I kept getting an OutOfMemoryException with no relation to the amount of free memory on the computer.

Eventually I found the bug: turns out the DrawArc method doesn't like to be called with a very small angle, so it goes BOOM.

Another tidbit I found while searching for the cause was the fact this behavior is not unique to this method:

"The thing I can add about this is that GDI+ tends to throw OutOfMemoryException when something else is going on. I've seen people complaining about this in the newsgroups and elsewhere on the internet.

So we have here a framework with the habit to fail very un-responsibly. Hmm, why does that sounds familiar?

Somehow I get the feeling that while Microsoft employ 50 people to handle a single feature,  no one is left to take care of exceptions and errors in their products.

 

(in the photo: Windows Vista security exception)

תוכן התגובה

Noam כתב/ה:

How about sample code from MSDN that doesn't work or crash ?? :blogs.microsoft.co.il/.../servicebase.aspx

See this example

# May 27, 2008 8:39 AM