MyApplication_UnhandledException: Get more information about the error

vbCrLf

New member
Joined
Jun 19, 2007
Messages
2
Programming Experience
5-10
Hello.
I'm using MyApplication_UnhandledException to catch all errors in my program.
Is it possible to get more information about the error except for the message itself (like line number, file, method, and so on)?
Thanks,
Ori Lahav.
 
What more information do you need?

It is possible to extend the exception class and add functionality to types of exceptions and there are hundreds custom exceptions provided by the .NET framework. It works like the generic object for anything or the control object for controls. In the end every exception inherits from the exception class which somewhere down the line also inherits from the object class.

So basically, you can make your own exceptions that you throw. Or figure out which type of exception it is when you catch it and see what extra functionality this provides


Steve
 
Maybe I wasn't clear enough. When an exception will occur in any place in my program, MyApplication_UnhandledException will raise and show a message box with the line number, method name, file name or any other useful (for debugging) data.
Thanks,
Ori Lahav.
 
Check properties like StackTrace, InnerException, TargetSite of exception object

Hello.
Is it possible to get more information about the error except for the message itself (like line number, file, method, and so on)?

I think you will get all the information from the exception object itself, like StackTrace, InnerException, TargetSite, Source etc. Also hope this article will help you http://www.codeproject.com/dotnet/ExceptionHandling.asp
 
Back
Top