handling unhandled exceptions
i found this in the help file:
To log an unhandled exception
Have a project selected in Solution Explorer. On the Project menu, choose Properties.
Click the Application tab.
Click the View Application Events button to open the Code Editor.
This opens the ApplicationEvents.vb file.
Have the ApplicationEvents.vb file open in the Code Editor. On the General menu, choose MyApplication Events.
On the Declarations menu, choose UnhandledException.
The application raises the UnhandledException event before the main application runs.
Add the My.Application.Log.WriteException method to the UnhandledException event handler.
and then i add this:
Code:
My.Application.Log.WriteException(e.Exception, _
TraceEventType.Critical, _
"Application shut down at " & _
My.Computer.Clock.GmtTime.ToString)
heres a stupid question: wheres the log kept at? how do i read it?
also, i saw that theres a setting in the unhandled exception event that can be set so that the app isnt terminated when the event is raised. how do i change this?
__________________
Re: handling unhandled exceptions
Quote:
Originally Posted by dreamdelerium
heres a stupid question: wheres the log kept at? how do i read it?
:rolleyes: If you read the documentation for the My.Application.Log.WriteException method it provides links to topics that answer those questions.
Quote:
also, i saw that theres a setting in the unhandled exception event that can be set so that the app isnt terminated when the event is raised. how do i change this?
It's a property of the UnhandledExceptionEventArgs object that is passed to the event handler via the 'e' parameter. How do you usually set a property? Same applies here.