Is there an exception in .NET like Delphi EAbort?
I am currently defining my own "AbortProcess" inheriting Exception. Together with the My.Application.UnhandledException handler, which ignores the "AbortProcess", I'm still wondering if a similar mechanic exists in .NET.
Class AbortProcess
Inherits System.Exception
End Class
Sub Abort()
Throw New AbortProcess()
End Sub
Sub AppDomain_UnhandledException(ByVal sender As Object, ByVal e As ApplicationServices.UnhandledExceptionEventArgs)
If TypeOf e.Exception Is AbortProcess Then
e.ExitApplication = False
End If
End Sub
Sub PerformActions()
Action1()
If Not Action2() Then
Abort()
End If
Action3()
...
End Sub
How does a typical .NET developer handle this use case?
UPDATED:
, , . , , , , ; . , ANTLR , (RecognitionException) . Python StopIteration, , Exception . , Delphi VCL.