I am sending info to another site that goes down every now and then... In the event that it is down or another error occurs I would like to run a specific function so that the customer does not see that there is an issue, but I still get there information.
Here is what I have so far:
-
protected void btnSubmit_Click(object sender, EventArgs e)
-
{
-
//sendSmallShippingEmail();
-
try
-
{
-
SendtoX();
-
}
-
catch
-
{
-
sendSmallShippingEmail();
-
}
-
}
-
Basically what I want to happen is to use just one or the other, not both. If the SendtoX does not work the function in the catch should work. Right now it is doing both if the site is working and just the email when the site is down. Any ideas? I have done some reading about try/catch, but there are no examples of using it the way I would like to. If there is a better way to deal with this please let me know.