Tuesday, June 28, 2005

255 possible causes

I'm currently working with serialization via binary formatters in .NET. I ran across this exception thrown by the ObjectReader's Deserialize() method a little while ago, which I find particularly amusing:

"Binary stream does not contain a valid BinaryHeader, 255 possible causes, invalid stream or object version change between serialization and deserialization      "

Only 255? Gee, and I thought this was going to be hard!

I like the trailing spaces tacked onto the end of the exception text too; that's a nice touch.

<sigh />

No comments: