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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T03:45:00+00:00 2026-05-18T03:45:00+00:00

So I never got into detailed error processing too much when I played in

  • 0

So I never got into detailed error processing too much when I played in VBA/VB6 a lot. Mostly then, if you ran into a user error (such as some input of theirs failing a validation test of some kind), you popped a MsgBox() with some error information and the critical (or warning) icon, and safely aborted out of the code and hope they got a clue.

In .NET, my reading basically points to exceptions as the end-all in error handling. It looks to me that if you know a spot of code where a user can screw up, you’re supposed to catch it with either try…catch blocks (for things like data conversions), or standard if…the…else constructs for other things, and then throw a new exception if needed.

Isn’t throwing an exception essentially a forced crash of a program in a sense (granted, you get the option of continuing)? Or are exceptions geared specifically for things like data conversion errors and other “things that shouldn’t happen”, and resume use of MsgBox() and friends for minor user screwups?

Consider the case of where you have a TextBox that is only supposed to accept numeric data (or heck, just a specific set of characters). Barring some other trick that lets you restrict that field (let’s just assume it’s freeform, programatically), it would seem a bit of a waste to throw new exceptions everytime they type in an invalid character, or even if the error checking doesn’t happen until they press a submit button (like on a webpage). Popping a MsgBox() seems more sane in that case.

So what’s the straight dope on exceptions and throwing new ones on user errors? How about if your program also exposes a programmatic framework? Bad usage of one of the programmatic functions definitely seems like new exception territory to me.

  • 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-18T03:45:00+00:00Added an answer on May 18, 2026 at 3:45 am

    Exceptions in .NET certainly are available for bad entry, not just the things that should never go wrong. In any case, you shouldn’t be letting unhanded exceptions get to the user.

    You’re probably going to displaying a MsgBox whether you ‘testing’ the input, or letting the framework detect an exception, so it doesn’t make a huge amount of difference. Seeing as exceptions are generally slow, you should probably use ‘if’ statements to capture the obvious validation errors, and rely on exceptions to capture the more obscure scenarios.

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

Sidebar

Related Questions

I've always been dabbling in javascript, but never really got hugely into writing a
I got into the habit of coding my error handling this way: NSError* error
I got something strange into VB.NET, never notice before... I have a class in
A problem I ran into a while back I never found a good solution
I've been programming for some time but never got interested in knowing in theory
I posted this earlier on wordpress.stackexchange.com. However, never got a reply. Hence, trying my
Basically, I have the same question as this one , which unfortunately never got
I've never used Java AWT before and now I've got a piece of code
I've got the following code: try { ... try { // This is *never*
I just got a job offer to be a FE Developer, but I've never

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.