Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 304215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:15:35+00:00 2026-05-12T07:15:35+00:00

Does .NET has an Exception that similar to Delphi’s EAbort ? Currently, I define

  • 0

Does .NET has an Exception that similar to Delphi’s EAbort ?

Currently, I define my own “AbortProcess” inheriting Exception.
Together with My.Application.UnhandledException handler that ignoring “AbortProcess”
I’m still wondering if similar mechanic in .NET is already exists.

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 typical .NET developer handle this use case ?

UPDATED:

For some reasons a number of people down vote this question, unfortunately, without giving any comment. The only reason I can figure out is that they might believe Exception should never be used to control program flow; and I tend to agree with that. However, I recently study ANTLR and find that they indeed use custom Exception (RecognitionException) as control flow construct. Together with Python’s StopIteration usage, I believe that using Exception as control flow construct is actually already being used broadly. It’s just not being standardize like in Delphi VCL.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T07:15:35+00:00Added an answer on May 12, 2026 at 7:15 am

    There are two qualities that define Delphi’s EAbort exception class.

    1. The IDE comes pre-configured to not interrupt your program when it detects an exception of that class being raised.
    2. The main application exception handler recognizes EAbort and its descendants and does not display the usual message box when it catches such an exception.

    It looks like the code you’ve proposed accomplishes the second part. You can configure Visual Studio for the first part; refer to the answer to another Stack Overflow question, Is there a better way to get Visual Studio to ignore try/catch in debug mode? I’m not aware of any exception class already designated for that.

    The EAbort exception is meant to make the program stop running whatever event or message handler it’s running and resume at the main message loop. In order for that to really work, though, all your other code needs to be written to handle exceptions properly. That is, they need to use finally sections to keep themselves in stable and consistent states, and they need to either rethrow or never catch exceptions that they aren’t really capable of fixing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anybody know if Microsoft has already decided which version of the .NET framework
Does .NET come with a class capable of representing extremely large integers, such as
Does .NET Compact Framework 3.5 work on Windows Mobile 2003 SE without limitations?
Does .net have a way to determine whether the local filesystem is case-sensitive?
Does Mono .NET support and compile C++ / CLI? If not, do you know
Does dot net have an interface like IEnumerable with a count property? I know
Does ASP.NET MVC have anything like the RESTful out-of-the-box features like Ruby on Rails
Does ASP.NET MVC provide a standard validator functionality or do you have to create
Why does C#.Net allow the declaration of the string object to be case-insensitive? String
How does ADO.Net know which version of the SQL Native Client to use if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.