Simen kjaeraas wrote:
> Lutger <lutger.blijdest...@gmail.com> wrote:
> 
>> Simen kjaeraas wrote:
>>
>> ...
>>> If it cannot send the email, it may throw an Exception. If you try and
>>> pass it a handwritten letter, it should throw an Error.
>>>
>>
>> This is the question: should I segfault on a handwritten letter even
>> if it is
>> not such an important letter and could just go on operating?
> 
> Yes. If someone is passing your email system a handwritten letter,
> something is so wrong, the program should balk and exit. It's not just
> a small mixup, it's an indication something is completely wrong.
> 
        Bad example. If someone is passing bad input to your program, it
should signal the mistake and recover. External input must *always*
be checked and wrong inputs must be recovered from gracefully.

        However, if you take (and check) the user input, then put it in a
queue, then take things from the queue for processing, and you get a
handwritten letter out of the queue, *then* it is an error and
cannot be recovered from (because this should have been checked for
before putting the letter in the queue and if this is messed up, you
don't know what else may be messed up nor how bad the situation is).
Which is what you say after:

> As Walter put it, an Error, be it an AssertError or otherwise, means
> your program has ventured into uncharted territory, and behavior from
> this point on is undefined. "Permissible undefined behavior ranges
> from ignoring the situation completely with unpredictable results, to
> having demons fly out of your nose."[1]
> 

                Jerome
-- 
mailto:jeber...@free.fr
http://jeberger.free.fr
Jabber: jeber...@jabber.fr

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to