Error Handler

  • Thread starter Thread starter marcmc
  • Start date Start date
M

marcmc

Hi,

I am trying to install a errorhandler that will collect
and format to the screen any exceptions (managed and
unmanaged) that may occur in my mobile application. I
want things such as stack(if possible), user_id,
device_id(which i already know how to get), form that was
active when exception occurred etc. At the moment I just
want to catch the exception thrown and put it in a text
box on another panel.
Does anybody have any design guidelines, examples or
information on this kind of installation?
 
At the moment I just
want to catch the exception thrown and put it in a text
box on another panel.
Does anybody have any design guidelines, examples or
information on this kind of installation?


As in a Try / Catch block?

//create a label on your form and name it lblStatus

try
{
//main code to run/test goes here, if error occurs, catch block is
called
}
catch (Exception runErr)
{
//print error out to the label you created
lblStatus.Text = runErr.Message;
}
finally
{
//code to call regardless of error or not
}

not sure if that's what your looking for, but it'll print the exception to a
label (or textbox)
 
Back
Top