G
Guest
I wish to make sure all unhandled exceptions (UE) are handled by a central
handler.
For primary thread UEs, this may be done by
string exceptionText;
AppDomain.CurrentDomain.UnhandledException +=
delegate(object sender, UnhandledExceptionEventArgs e)
{
exceptionText = e.ExceptionObject.ToString();
};
However, this does not work for UEs thrown from a secondary thread like the
timer object (not the forms control).
In this case, the secondary thread is not known until the timer event fires.
Any ideas please?
handler.
For primary thread UEs, this may be done by
string exceptionText;
AppDomain.CurrentDomain.UnhandledException +=
delegate(object sender, UnhandledExceptionEventArgs e)
{
exceptionText = e.ExceptionObject.ToString();
};
However, this does not work for UEs thrown from a secondary thread like the
timer object (not the forms control).
In this case, the secondary thread is not known until the timer event fires.
Any ideas please?