On Mon, 30 Aug 2004 12:28:52 +0300
"Vladimir Ciobanu" <> wrote:
> > I would only need the error-number or something like a short
> > description
> > which exception occured, and subsequently I want to write it to a
> > logfile.
> > Therefore I want to log every exception, and not a specific
> > exception I had
> > to define beforehand.
>
> Ok, I'll admit. If the exceptions have a common base class, you can
> catch them
> by a reference to that class (and all the standard exceptions derive
> from
> std::exception).
And make sure you've noticed it's a REFERENCE to std::exception.
Otherwise you'll get the object slicing problem due to the
pass-by-value-mechanism, which results in converting a derived class
type into the base one (by calling std::exception's copy constructor),
with all consequences such as losing new class members.
best regards / Gruß
Moritz Beller
--
web
http://www.4momo.de
mail momo dot beller at t-online dot de
gpgkey
http://gpg.notlong.com