Hi
I have two questions.
1) every one might have saw this "Do not catch general exception types" many times.
I always catch general exception try{...} catch(Exception ex){} when ever i get if any.
i wonder how do i check what type of exceptions i may get from the try block of code.
http://madskristensen.net/post/Do-not-catch-general-exception-types.aspx has below example.
try
{
// Do something with an XML file
}
catch (XmlException)
{
Console.WriteLine("The XML has been corrupted");
}
catch (UnauthorizedAccessException)
{
Console.WriteLine("You do not have permission to save the document. Make sure the file isn't write protected.");
}
in the above code block, xmlexception and UnauthorizedAccessException exceptions are caught, but how do the author know that these exceptions may raise?
other exceptions may also raise, what are they and how would ...
Go to the complete details ...