In my current error handling, I specify the Form, function and error message in a messagebox similar to the following.
try
{
//Some code here
}
catch(Exception ex)
{
MessageBox.Show("Form Title : " + this.Title + "\nFunction : CurrentFunction \nError : " + ex.Message);
return;
}
This works for me, but was curious if I can make the process even more simple, and generate the function name, instead of typing it out every time I want to display the error message.
Additionally: I know you can include the stacktrace and view the top few lines, but I was curious if there was a cleaner way to show the function.