Thursday, 31 January 2013

Asp.net will actually let you handle errors like this

VB.Net on a ASP.Net completely legit web page will do this:
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        On Error GoTo OwDear
Stupid:
        On Error Resume Next
        Throw New Exception("Dun gone wrong.")
        On Error GoTo OwDear
        Throw New Exception("Another error.")
OwDear:
        MsgBox("Another error.")

    End Sub
Documented: http://msdn.microsoft.com/en-us/library/5hsw66as.aspx This is just awful!