Monday, January 08, 2007

More Uninformative Exceptions
(in the sense of more of them as opposed to less informative)


Since my last post I found this bug which has been open since 2001.

Its the comment from webrejin which I liked... "why does a FileNotFoundException not tell which file was not found?"

If you can think of any others let me know, or add them to that bug, or just vote for it.


Comments:

Unknown said...

I'll agree with ClassCastException (or InvalidCastException for us C# people)
It'd be quite nice to get
InvalidCastException "TcpSocket cannot be cast as string" type thing.

But the FileNotFound *shouldn't* tell you where it was looking,
- imagine in a web environment if people saw the file structures of your server through the error messages. - I reckon it raises security problems

Anonymous said...

"imagine in a web environment if people saw the file structures of your server through the error messages"

I think you'd be making a mistake if you let the internal error messages end up on the screen.

You should use simple error codes to allow your users to report errors, and keep sensitive information safe in the error log.

blog comments powered by Disqus

I know nothing, I'm not a fortune teller, and you'd be insane to think that I am. This disclaimer was cribbed from an email footer I once received. It is so ridiculous I had to have it for myself.

Statements in this blog that are not purely historical are forward-looking statements including, without limitation, statements regarding my expectations, objectives, anticipations, plans, hopes, beliefs, intentions or strategies regarding the future. Factors that could cause actual results to differ materially from the forward looking statements include risks and uncertainties such as any unforeseen event or any unforeseen system failures, and other risks. It is important to note that actual outcomes could differ materially from those in such forward-looking statements.

Danny Angus Copyright © 2006-2013 (OMG that's seven years of this nonsense)