I have an ASP.Net MVC application that has some reports that can throw Execution Timeout Expired errors.
I have already set a longer execution timeout in my controller and have also doubled the standard execution timeout in my connection string.
There are still instances where a few people are trying to search all records with limited input using a wild card. For these few instances I want to handle this in my catch block and display a custom message instead of having them see my generic error message that is displayed.
My question is this: Is there a way to do something like this?
catch (Exception ex)
{
if (ex == System.TimeoutException)
{
Errors.ErrorOccured(ex);
return RedirectToAction("TimeoutError", "Error");
}
Errors.ErrorOccured(ex);
}
return RedirectToAction("InternalServerError", "Error");