Article

From:
To:
Lord Crc
Subject:
Re: Exceptions vs Error codes
Newsgroup:
borland.public.delphi.objectpascal

Re: Exceptions vs Error codes

In article <✉4ax.com>
	Lord Crc <✉hotmail.com> wrote:

> On Tue, 14 Aug 2001 03:16:12 +0100, Barry Kelly <✉eircom.net>
> wrote:
> 
> >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 tend to mute all exceptions in the execute block of a thread, for
> instance (otherwise the app has a mysterious tendecy to suddenly
> dissappear).

Pre D6, yes. You must have a bed-rock of exception handling, unless you
want all error conditions to be fatal.

> I often catch exceptions raised by TFilestream, so the
> user can get a notice in a gracefull manner that the file is locked or
> the free diskspace is no more.

There, I think that's a bad idea.

> When sending streams as ISAPI responses, i free the stream object 
> if an exception occurs. 

Of course you do. That isn't a try..except block; that's a try..finally
block.

> And i catch everything i do in DLL's.

You can't do anything else in intra-language mechanisms. That's what
COM's HRESULTs are all about.

> Thats the main places i use them. So, any of your 95% apply here? Im
> curious.

I'm talking more about what I see in actual code.

-- Barry
--   If you're not part of the solution, you're part of the precipitate. Team JEDI: http://www.delphi-jedi.org NNQ - Quoting Style in Newsgroup Postings   http://web.infoave.net/~dcalhoun/nnq/nquote.html
FYI: Phrase searches are enclosed in either single or double quotes
 
 
Originally created by
Tamarack Associates
Tue, 07 Feb 2023 04:39:35 UTC
Copyright © 2009-2023
HREF Tools Corp.