you can use
try
{
}
catch(Exception e)
{
//it will get all errors in the try block.
}
You can use Global.asax for catch any error in the website & an error page for showing this error.
Example:
void Application_Error(object sender, EventArgs e)
{
string message = "";
if (Server.GetLastError() != null)
message = Server.GetLastError().InnerException.ToString();
Session["Errormessage"] = message;
HttpContext.Current.Response.Redirect("~/error.aspx");
}