Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This is some VB code we use, it provides enougth info for us to diagnose most problems. Only downside with emailing errors like this is when there is a major failure you can end up with thousands of messages in your mailbox :(</p> <pre><code>Dim e As Exception If System.Web.HttpContext.Current.Request.IsLocal Then Exit Sub e = System.Web.HttpContext.Current.Server.GetLastError If e IsNot Nothing Then If TypeOf e Is HttpException Then Dim he As HttpException = DirectCast(e, HttpException) If he.GetHttpCode=404 Then System.Web.HttpContext.Current.Server.ClearError() Response.Redirect("/") Exit Sub End If End If MsgBody += "Exception: " &amp; e.Message &amp; vbCrLf &amp; vbCrLf MsgBody += e.ToString &amp; vbCrLf &amp; vbCrLf &amp; vbCrLf Else MsgBody += "Unknown Error" &amp; vbCrLf &amp; vbCrLf &amp; vbCrLf End If If System.Web.HttpContext.Current.Request.Url Is Nothing Then MsgBody += "URL: ?" &amp; vbCrLf &amp; vbCrLf Else MsgBody += "URL: " &amp; System.Web.HttpContext.Current.Request.Url.ToString &amp; vbCrLf If System.Web.HttpContext.Current.Request.RawUrl IsNot Nothing Then MsgBody += System.Web.HttpContext.Current.Request.RawUrl &amp; vbCrLf MsgBody += vbCrLf End If If System.Web.HttpContext.Current.Request.UrlReferrer Is Nothing Then MsgBody += "Referer: &lt;direct&gt;" &amp; vbCrLf &amp; vbCrLf Else MsgBody += "Referer: " &amp; System.Web.HttpContext.Current.Request.UrlReferrer.ToString() &amp; vbCrLf &amp; vbCrLf End If If User IsNot Nothing Then MsgBody += "User: " &amp; User.Identity.Name &amp; vbCrLf MsgBody += "User-Agent: " &amp; System.Web.HttpContext.Current.Request.UserAgent &amp; vbCrLf MsgBody += "User-IP: " &amp; System.Web.HttpContext.Current.Request.UserHostAddress &amp; vbCrLf MsgBody += "Server: " &amp; System.Environment.MachineName &amp; vbCrLf MsgBody += vbCrLf &amp; "RequestType: " &amp; System.Web.HttpContext.Current.Request.RequestType() &amp; vbCrLf &amp; vbCrLf ' dump request items ' QueryString, Form, Cookies, ServerVariables MsgBody += "Querystring Variables ================" &amp; vbCrLf If Request.QueryString.Count &gt; 0 Then For Each key As String In Request.QueryString.Keys MsgBody += key &amp; " = " &amp; Request.QueryString(key) &amp; vbCrLf Next Else MsgBody += "(none)" &amp; vbCrLf End If MsgBody += vbCrLf MsgBody += "Form Variables =======================" &amp; vbCrLf If Request.Form.Count &gt; 0 Then For Each key As String In Request.Form.Keys MsgBody += key &amp; " = " &amp; Request.Form(key) &amp; vbCrLf Next Else MsgBody += "(none)" &amp; vbCrLf End If MsgBody += vbCrLf MsgBody += "Cookies ==============================" &amp; vbCrLf If Request.Cookies.Count &gt; 0 Then For Each key As String In Request.Cookies.Keys MsgBody += key &amp; " = " &amp; Request.Cookies(key).Value &amp; vbCrLf Next Else MsgBody += "(none)" &amp; vbCrLf End If MsgBody += vbCrLf MsgBody += "ServerVariables ======================" &amp; vbCrLf If Request.ServerVariables.Count &gt; 0 Then For Each key As String In Request.ServerVariables.Keys MsgBody += key &amp; " = " &amp; Request.ServerVariables(key) &amp; vbCrLf Next Else MsgBody += "(none)" &amp; vbCrLf End If MsgBody += vbCrLf ' we send MsgBody via email using the System.Net.Mail.MailMessage &amp; System.Net.Mail.SmtpClient classes ' we've handled the error System.Web.HttpContext.Current.Server.ClearError() ' depending on the error we redirect to our homepage /default.aspx unless that is the faulting page then redirect to static /error.html </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload