Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I haven't tested all of this, but you could try re-throwing the exception.</p> <pre><code>Catch ex as exception CreateLogFile(Ex) Throw End Try </code></pre> <p>Then, to handle that, add a new "Global Application Class" to your solution. Visual Studio should then create a new file, Global.asax. In its code behind, do something like:</p> <pre><code>Public Class Global     Inherits System.Web.HttpApplication     Protected Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)         Server.Transfer("~/Error.aspx")     End Sub End Class </code></pre> <p>The benefit of that is it will catch any uncaught exceptions. So then, once in Error.aspx, or whatever:</p> <pre><code>Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)     Dim ex As Exception = Server.GetLastError()     If ex Is Nothing Then         'Can't determine last error     Else         ex = ex.GetBaseException()                 If ex Is Nothing Then             'Can't determine last error         Else             'Display error message         End If     End If End Sub </code></pre> <p>^ For some reason the syntax highlighting javascript is taking those comments as strings.</p> <p><strong>IMPORTANT NOTE:</strong> If, in any of your previous questions, you received an answer that helped you, maybe consider going back and clicking the green check mark next to that answer. It'll make people more likely to provide answers to your future questions.</p>
 

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