Lord Crc
Re: Exceptions vs Error codes

Re: Exceptions vs Error codes

In article <✉>
	Lord Crc <✉> wrote:

> On Tue, 14 Aug 2001 03:16:12 +0100, Barry Kelly <✉>
> 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

> 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: NNQ - Quoting Style in Newsgroup Postings
FYI: Phrase searches are enclosed in either single or double quotes
Originally created by
Tamarack Associates
Fri, 22 Sep 2023 01:14:03 UTC
Copyright © 2009-2023
HREF Tools Corp.