In ASP.NET,How can i know the Specific details about an exception (like What kind of Exception it is (FileNotFound /Arithmentc etc..) )from a General Exception class object
views:
39answers:
2
+1
A:
You can use GetType()
method to get the actual type of the exception instance.
If you are interested in some property of a specific type of exception and you're sure about the type, just cast the exception to the type and fetch the property value.
Alternatively, you can use reflection to interrogate the object and retrieve all of its properties.
Mehrdad Afshari
2010-02-04 15:27:45
+1
A:
If you need the full details (stack trace, names and such) from an exception object, use the overloaded ToString()
on it. It gives quite a lot of information.
Oded
2010-02-04 15:29:04