R
rickbear
Hi Group,
I am using StreamReader in a program I develop.
In the MSDN it says the constructor can throw these exceptions:
ArgumentException
ArgumentNullException
FileNotFoundException
DirectoryNotFoundException
IOException
But when when doing this:
StreamReader someReader = new StreamReader("\\");
I get an "UnauthorizedAccessException".
I know the above example is useless, but I stumbled over it by
accident. My question is more in general:
Why isn't that noticed in the MSDN? And how can I be sure to catch all
expected exceptions if I will not catch the super exception
"Exception"?
- rick -
I am using StreamReader in a program I develop.
In the MSDN it says the constructor can throw these exceptions:
ArgumentException
ArgumentNullException
FileNotFoundException
DirectoryNotFoundException
IOException
But when when doing this:
StreamReader someReader = new StreamReader("\\");
I get an "UnauthorizedAccessException".
I know the above example is useless, but I stumbled over it by
accident. My question is more in general:
Why isn't that noticed in the MSDN? And how can I be sure to catch all
expected exceptions if I will not catch the super exception
"Exception"?
- rick -