Re: class for database handling errors
On 10 mai, 15:19, Jerry Coffin <jcof...@taeus.com> wrote:
[...]
First of all,
absent some _really_ good reason to do otherwise (which I've yet to
encounter) an exception handler should be written to receive a reference
to a (possibly const) object.
I have:-). It's a special case, but in some applications, where
it would normally make sense to call exit() somewhere deep in
call hierarchy, I adopt the convention of throwing an int (the
return code) instead; main catches int and returns. In other
words, I call exit, but only after having executed all of the
intermediate destructors. And of course, there's no point in
catching int with a reference.
(For the rest, I agree with all you've said. I just thought I'd
mention this one special case.)
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34