I would say, in general, you do not want the user to experience YSOD. This is what I put in web applications before grabbing the error and then allowing the user a more graceful error page ...
protected void Application_Error(object sender, EventArgs e) { MailMessage msg = new MailMessage(); HttpContext ctx = HttpContext.Current; msg.To.Add(new MailAddress(" me@me.com ")); msg.From = new MailAddress(" from@me.com "); msg.Subject = "My app had an issue..."; msg.Priority = MailPriority.High; StringBuilder sb = new StringBuilder(); sb.Append(ctx.Request.Url.ToString() + System.Environment.NewLine); sb.Append("Source:" + System.Environment.NewLine + ctx.Server.GetLastError().Source.ToString()); sb.Append("Message:" + System.Environment.NewLine + ctx.Server.GetLastError().Message.ToString()); sb.Append("Stack Trace:" + System.Environment.NewLine + ctx.Server.GetLastError().StackTrace.ToString()); msg.Body = sb.ToString();
RSolberg
source share