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

  • SEARCH
  • Home
  • 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 892323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:02:07+00:00 2026-05-15T14:02:07+00:00

Question: I catch generally unhandled exceptions with AddHandler System.AppDomain.CurrentDomain.UnhandledException, AddressOf OnUnhandledException The problem now

  • 0

Question: I catch generally unhandled exceptions with
AddHandler System.AppDomain.CurrentDomain.UnhandledException, AddressOf OnUnhandledException

The problem now is, with this exception handler

Public Sub OnUnhandledException(ByVal sender As Object, ByVal e As UnhandledExceptionEventArgs)
    Console.WriteLine(e.ExceptionObject.ToString())
    Console.WriteLine("Press Enter to continue")
    Console.ReadLine()
    'Environment.Exit(1)
End Sub

program execution still throws the exception if I don’t exit the program.
Now I want to know how I can change that to a ‘on error resume next’ behaviour ? Is it possible at all ?

    <STAThread()> _
Public Sub Main(ByVal argv As String())
    'For i As Integer = 0 To argv.Length - 1 Step 1
    'Console.WriteLine("Argument {0}: {1}", i, argv(i))
    'Next i

    AddHandler System.AppDomain.CurrentDomain.UnhandledException, AddressOf OnUnhandledException

    Throw New Exception("Test")
    Console.WriteLine("Continue")
End sub
  • 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-15T14:02:08+00:00Added an answer on May 15, 2026 at 2:02 pm

    If you want to do anything beyond quickly logging or alerting the user of an exception before the program exits, you need to handle the exception normally with a try/catch block. Exceptions should be handled as soon as possible to make a real decision about how to react. UnhandledException may sound like it would be a great place to centralize all your exception handling, but that’s not it’s intended purpose and would get very complicated if it had to handle every exception thrown anywhere in the application.

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

Sidebar

Related Questions

I have a question about how to catch the exception in the initialization list.
I have a couple questions about exceptions. 1) when you hit a catch block,
I've recently implemented some vectored exception handling to catch errors in our software. This
Okay this might sound simple but there's a catch. I'll try and explain the
Thanks for the input on this question , I've decided to go with making
this is a General Question about MVC .. I wrote a PHP Class that
This question has been asked in different ways before, but the answers don't help
This is kind of a 2 part question: 1) What is the better approach,
This is more of a general programming question so the code examples I give
This may be a question for a different forum, if so please let me

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.