Re: When to create your own exception class?
- From: "Carlos J. Quintero [.NET MVP]" <carlosq@xxxxxxxxxxxxxxxxxxx>
- Date: Tue, 28 Jun 2005 19:12:11 +0200
IMO, there are 2 kind of exceptions:
- The ones that are to "blame" the user: an incorrect format for some data,
a directory entered in a textbox that really does not exist, and attempt to
delete a record which has children, and so on. Of course, programs should
expose a good user interface to prevent those exceptions. For example, the
UI may validate that some data is required before causing a "primary key
missing" exception, but if they happen, the user can correct it if he is
provided with a friendly explanation.
- The ones that are not to "blame" the user, but the software or the system,
which are the majority. In this case, it is pointless to show the user the
description of the exception or the details, since he/she won´t understand
anything. A message like "This application has encountered an error which is
not your fault, please click the Send Report button and restart it" it is
more suitable, IMO.
Alan Cooper wrote a very good book (About Face) about user interfaces and
some chapter about how to deal with errors in apps...
--
Best regards,
Carlos J. Quintero
MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
"Jon Skeet [C# MVP]" <skeet@xxxxxxxxx> escribió en el mensaje
news:MPG.1d2b9153bb30104298c3ce@xxxxxxxxxxxxxxxxxxxxxxx
> I'm not at all convinced about that one. Chances are, the exception is
> dealing with some concept that the user has *no* clue about. For
> instance, say a parameter is null when it shouldn't be - how can you
> explain that in non-technical terms? How many users are going to have
> the faintest idea what null is?
>
> In my experience, you need something at a much higher level to tell the
> user that something has gone wrong. The message displayed may depend on
> the exception generated, but it's unlikely to be known by the exception
> itself.
>
> --
> Jon Skeet - <skeet@xxxxxxxxx>
> http://www.pobox.com/~skeet
> If replying to the group, please do not mail me too
.
- References:
- When to create your own exception class?
- From: Allan Ebdrup
- Re: When to create your own exception class?
- From: Carlos J. Quintero [.NET MVP]
- Re: When to create your own exception class?
- From: Jon Skeet [C# MVP]
- When to create your own exception class?
- Prev by Date: Make a color transparent in a gif, jpg, bmp? Its black!
- Next by Date: Exception when rising event to javascript from the IE Hosted UserControl
- Previous by thread: Re: When to create your own exception class?
- Next by thread: Re: When to create your own exception class?
- Index(es):
Loading