I want a general catch all error that works for all functions. Right now I have a try and catch for each individual button click for specific events. I need a catch all error for my whole program which includes all button clicks that can catch any individual exception I might have missed. Can someone please point me in the right direction
My current code:
private void Show_btn_Click(object sender, EventArgs e)
{
try
{
//do something
}
catch (Exception error)
{
outputLOG.Append(error.ToString());
{
}
private void Submit_btn_Click(object sender, EventArgs e)
{
try
{
//do something
}
catch (Exception error)
{
outputLOG.Append(error.ToString());
}
}
Goal: I want to catch ALL buttons just in case I missed individual exceptions
EDIT: I am using winforms