Boost logo

Boost :

From: p.i.frey_at_[hidden]
Date: 2001-07-18 03:35:13


Hi,

I do not know whether there is a goot reason for doing so, but we are
also using a class library having exception classes that are not
derived from std::exception. We cannot rewrite this library, and we
need support for Boost.Python to pass these exceptions to Python.

Peter

--- In boost_at_y..., Ullrich Koethe <u.koethe_at_c...> wrote:
> Chris Emerson wrote:
> >
> > I've wrapped a C++ library which throws exceptions which I'd like
to be
> > visible from Python more sensibly. The exceptions don't derive
from
> > std::exception.
> >
>
> Is there any good reason not to derive from std::exception? I don't
see
> any.
>
> > It looks like all exception handling is done in
> > boost::python::handle_exception(). Perhaps module_builder could
have an
> > optional function pointer argument to add (or replace)
handle_exception()?
> >
>
> This could be done. However, to create corresponding Python
exceptions,
> you must register new Python exception objects within the module.
This
> is currently unsupported in Boost.Python.
>
> > Or is there a better way of accomplishing this?
> >
>
> Derive from std::exception
>
> Regards
> Ulli
> --


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