I have a function with a try
-catch
block. When I run the solution on localhost, it doesn't throw an exception. But when I run it on the server, I sometimes get the exception message "Object reference not set to an instance of an object."
The catch
block in my code looks like this:
catch (Exception e)
{
Mailing.SendMail(@gmail.com,
e.Message + Environment.NewLine + Request.UrlReferrer.OriginalString);
}
Whenever an exception is caught, I want to send an email.
My question is: can I get the trigger parameter or line from the exception?