In a previous post I asked what exception System.Image.FromFile() threw if you passed it a file that is not actually a supported image format. The answer?
Well, it's not 'UnsupportedImageFormatException', that's for sure. It's not even 'ArgumentException'. No, the answer is, it throws an 'OutOfMemoryException'.
Seriously. Look it up.
In the course of investigating this bizarre API decision, I also discovered that the .NET framework contains a subclass of OutOfMemoryException called an InsufficientMemoryException. Presumably so that you can distinguish between those circumstances when you have sufficient memory, but nonetheless have run out of memory...