[C++-sig] Re: Exception translation to python classes
s_sourceforge at nedprod.com
Tue Sep 23 01:16:26 CEST 2003
-----BEGIN PGP SIGNED MESSAGE-----
On 22 Sep 2003 at 12:50, Mike Rovner wrote:
> Niall Douglas wrote:
> > I was wondering if anyone had any experience or could point me to
> > some example code for translating C++ exceptions by using
> > PyErr_SetObject to the Boost.Python wrap of the appropriate C++
> > exception object.
> I'm not quite sure what are you talking about.
Ok, an example then:
FXException is my generic base class for all exceptions. It has
bindings for Python ie; a FXException is available there too.
I've registered an exception translator for FXException. If what you
say below is correct, then it merely needs to be:
void FXException_translator(const FXException &e)
... and all should be good.
If so, then my thanks again. This makes error reporting in python
much more useful indeed as my exception class provides a stack
backtrace plus line and file info of the C++ side.
-----BEGIN PGP SIGNATURE-----
Version: idw's PGP-Frontend 18.104.22.168 / 9-2003 + PGP 8.0.2
-----END PGP SIGNATURE-----
More information about the Cplusplus-sig