L
Laxmikant Rashinkar
Hi,
I am working with a program that someone else wrote.
This program is full of bugs and unhandled exceptions are thrown all over
the code.
Instead of trying to catch the exception at each point it is thrown, I am
wondering
if it is possible to catch all exceptions at a top level. I tried the
following but it does not work.
Does anyone have any ideas about how this can be achieved?
thanks a lot
LK
-----
class Form1 : System.Windows.Forms.Form
{
[STAThread]
static void Main()
{
try
{
Application.Run(new Form1());
}
catch(Exception ex)
{
// unfortunately this does not catch any exceptions for me
}
}
}
I am working with a program that someone else wrote.
This program is full of bugs and unhandled exceptions are thrown all over
the code.
Instead of trying to catch the exception at each point it is thrown, I am
wondering
if it is possible to catch all exceptions at a top level. I tried the
following but it does not work.
Does anyone have any ideas about how this can be achieved?
thanks a lot
LK
-----
class Form1 : System.Windows.Forms.Form
{
[STAThread]
static void Main()
{
try
{
Application.Run(new Form1());
}
catch(Exception ex)
{
// unfortunately this does not catch any exceptions for me
}
}
}