On Mon, 16 Apr 2007 07:32:58 -0700, cbmeeks <cbmeeks@gmail.comwrote:
Quote:
On Apr 16, 10:26 am, "Marc Gravell" <marc.grav...@gmail.comwrote:
Quote:
>That doesn't sound like a kludge to me. You are catching a specific
>error for a known, expected reason, and reacting accordingly. Sounds
>fine IMO.
>>
>Marc
>
Thanks.
>
I really didn't see any other way but I wanted to make sure.
I agree with Marc. IHMO, the reason is *seems* kludgy is probably that
you're used to checking for error return codes and taking appropriate
action based on that. I mean, I don't know what your experience is, but
that's how it is for me. In the "olden days", the only time I ever dealt
with code that used any form of exception handling (setjmp/dojmp), the
exceptions were VERY exceptional. Basically for fatal failures only. We
still used return codes to indicate less-problematic failures, ones that
were benign or could be recovered from.
But .NET uses exceptions for practically any failure. An operation is
assumed to have succeeded, and if it doesn't it throws an exception. This
is just the normal way things work in .NET, and checking for a specific
exception and handling it gracefully is perfectly fine and appropriate.
(As Marc already said, I know :) ).
Anyway, that's not really all that pertinent...just sharing my own
difficulties in getting used to the .NET paradigm, in case they relate to
your own concerns in any way.
Pete