Attention: We are retiring the ASP.NET Community Blogs. Learn more >

Is it an exception or is it an error?

Perhaps a dumb question, but with the introduction of the term "Exception" (at least to me) in .NET I find myself using this term instead of "Error".

Now, I have struggled with re-training users to think in terms of exceptions and not errors. Like "The System encountered a fatal exception" vs a

"fatal error". 

Am I the only one thinking like this? If not, would we be confusing users if we starting talking about exceptions vs. errors?

Like "Send me a copy of the exception" or, as our application does "The exception has been emailed to support". Will this confuse users and, if it does, is this a good thing long term to get them thinking about exceptions and not errors?

3 Comments

  • A well designed system will be consistant and not confuse the error regardless of the underlying technology. Ideally, in the worst-case scenario, a user-friendly message will be displayed with an error number that tech support could look up.



    But that aside, step outside of the programmers mindset and think like a "regular" person ...



    An "error" implies that a mistake has been made, somebody did something wrong. Clerical errors, doctor diagnostic errors, etc.



    An "exception" is something that happens outside of the norm. Not necessarily a mistake, but most certainly not something that you're used to dealing with. You say "no candy from strangers" but Halloween is an *exception* to the rule.



    With these definitions, its clear that "errors" are infact a subset of "exceptions" -- an error is most certainly an exception, but not all exceptions are errors.



    Now step back into programming and apply it. Going over all the Exceptions you've seen thrown, hopefully you'll understand why there was a shift from the word "error" (VB6, etc) to "exception".

  • Either way, it's not something that you wanted to happen, or at least the user didn't want it to happen. John Q. User understands "error" but not "exception."



    "Oh! Something exceptional happened! Sweet! What do I win?"

  • Normally error is a situation that occurs either due to some mistake or some unexpected event.

    Now there are some known errors that you expect to happen as well as you also may know the situation of the error. Such errors to are ready to take care.
    For example Every day you go to office by taking the shortest road. But if some day you state late for the office and stuck due to JAM, you take the alternate way and still manages to reach the office. So the JAM is a known error and you handle that in other words it's an exception that you expect and ready for that but the occurance of that exception is not known.

    Now lets assume a scenario that the alternate way you choose is blockes due to some reason and you have to waite still the block is cleared. This ia an unexpected situation and you are not able to handle.

    So the cunclution is Error and exceptions are complementry to each other.

    In the world of software an end user will call any unexpected behaviour as error while a programmer will tread that as unhandled exception.


Comments have been disabled for this content.