为什么我的vb代码不会停止在句号上?

ber*_*436 1 .net vb.net

我正在维护一些似乎不会停止在stop语句上的VB代码.

当我在某些条件下运行程序时,此代码从最后一行代码抛出System.Exception("Timed out").

但是,如果你逐行通过代码,似乎它永远不会出现这种说法.首先它尝试返回MyBase.Save.如果它不能,那么它将命中stop语句并停止.

但似乎该程序正在跳过停止声明.

我该如何调试这段代码?具体来说,它如何跳过stop语句以获取语句Throw New System.Exception("Timed out")

Public Overrides Function Save() As Uber

    If IsDeleted AndAlso Not CanDeleteObject() Then
        Throw New System.Security.SecurityException("User is not authorized to remove a Uber")
    ElseIf IsNew AndAlso Not CanAddObject() Then
        Throw New System.Security.SecurityException("User is not authorized to add a Uber")
    ElseIf Not IsNew AndAlso Not CanEditObject() Then
        Throw New System.Security.SecurityException("User is not authorized to update a Uber")
    End If

    Try
        Return MyBase.Save
    Catch ex As Exception

        Stop   //why is the code not stopping here?
    End Try

    Throw New System.Exception("Timed out")  //this line executes, but I don't see how the code gets there

End Function
Run Code Online (Sandbox Code Playgroud)

For*_*ard 5

我认为Stop只会为调试创建一个断点.

代码的执行将继续.

我认为在Return MyBase.Save中抛出异常.它被捕获在Catch块中,但它被该块有效地忽略,因为从未使用过ex.