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 6542475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:13:55+00:00 2026-05-25T11:13:55+00:00

I am in a position where I have a large user app that has

  • 0

I am in a position where I have a large user app that has quite a few forms and I am looking for a way to close a single form if an exception has occurred due to some logic that has been caught on that form.

Right now I am following the principal of ‘don’t write try/catch everywhere to catch boneheaded mistakes’ and it does make my code cleaner, but causes crashes the entire app when I have a NullPointerException.

The best solution would be a ‘local error handler’ that each form would have that would collect any exceptions at that level and kill the form there instead of it bubbling up and killing the entire app.

Anyone have any ideas?

  • 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-25T11:13:56+00:00Added an answer on May 25, 2026 at 11:13 am

    Can you derive your forms from a common base class, so they can share the same error handler? We have a base form that logs the exception, displays an error, and then closes the form (which is optional in debug mode). Every user event (button_click for example) is wrapped in a try/catch that calls the base error handler.

    Also, in case you didn’t know, there are global exception handlers:

    Application.ThreadException event

    AppDomain.UnhandledException event

    WindowsFormsApplicationBase.UnhandledException event (VB)

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

Sidebar

Related Questions

Have a matrix report now that has Position, Hours and Wages for a location
I have a textarea tag that has text I want a user to edit.
I have an IE6 absolute position div that I want to be full screen
I have an Panel control that I need to maintain position across postbacks. I
I have a div with float:right (no position property declared). This div has some
I have a very large, spread out class that is essentially a very contrived
My webpage has a large image (a map). I want to position, at the
We have a large suite of products that include: Desktop apps written in VB6.
I have a calendar, and when the user hovers over a cell, a large-ish
I have a large list of LDAP DN's that are all related in that

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.