Boost logo

Boost :

From: Gennaro Prota (gennaro_prota_at_[hidden])
Date: 2002-11-20 13:56:57


On Wed, 20 Nov 2002 08:53:21 -0500, Beman Dawes <bdawes_at_[hidden]>
wrote:

>Boost libraries often define exception classes, usually derived from the
>standard library exception hierarchy. Users sometimes ask for further
>refinement, so the library ends up with its own hierarchy.
>
>For example, the Filesystem library started out with
>boost::filesystem::filesystem_error, but reviewers asked for more specific
>exceptions at least for the most common errors (like "file not found".)

I'm surprised that the filesystem library uses exceptions for that. I
used to think the consensus among experts was to use a return value,
and complain about the Java library that does otherwise :-)

[...]
>Has anyone run into a comprehensive attack on these and similar exception
>class problems? Is there a better way than each Boost developer just
>hacking together individual exception classes? Could we do better with a
>Boost exception class or idiom?

For what my opinion is worth, I'm a little unwilling to have a
boost_exception base class, for the simple reason that conceptually
speaking it is not a part of the exception hierarchy. In other words
the fact that, say, bad_year is defined in the boost library shouldn't
affect its base type; the class should be coded the same way
regardless of the library it belongs to. Anyhow, I would accept the
compromise if it brings other important advantages.

Genny.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk