Article

From:
To:
Barry Kelly
Subject:
Re: Exceptions vs Error codes
Newsgroup:
borland.public.delphi.objectpascal

Re: Exceptions vs Error codes

"Barry Kelly" <✉eircom.net> wrote
in message
news:0d2hnt09m4r82qfpokg5a1pt36jd86jn0b@
4ax.com...
>
> Please list some valid uses of exception-swallowing try..except blocks,
> and I'll show you that the majority should have checked for error before
> doing whatever raised the exception.
>

I think it is fair to say that it
depends on how you specify a piece of
code. What should it do? under which
conditions should it fail or exit
abnormally? etc. IMO thorough
pre-validation of input data is
preferrable to relying entirely on the
occurrence of an exception. This is
because, it is possible that the
function you call can return incorrect
results without any exceptions raised
(or other error information) if you feed
it unchecked input data... and that
depends on how the lower level function
is specified, implemented and tested.

Kristofer
FYI: The plus sign, '+', may be used to include a word in a search (e.g. +delphi -database). Using the plus sign is optional. If not present, it is assumed.
 
 
Originally created by
Tamarack Associates
Mon, 20 May 2024 00:19:07 UTC
Copyright © 2009-2024
HREF Tools Corp.