[C++-sig] throw_error_already_set()
Niall Douglas
s_sourceforge at nedprod.com
Wed Dec 17 20:39:47 CET 2003
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Now I have my custom exception which interrogates python and builds a
very useful C++ exception replete with python traceback, I'd like
this to be generated whenever there's a python exception raised.
Unfortunately, the C++ exception error_already_set appears to be
thrown not only for python exceptions but also for internal BPL
errors. I'd far prefer BPL to keep throwing error_already_set when it
can't match parameter types etc. and throw my exception when it's
just a plain python problem. OTOH, BPL seems to set the python error
state when it throws error_already_set so maybe this is okay.
Is it possible to modify BPL to do this or am I relegated to wrapping
every BPL call with a try...catch(error_already_set &)? I did notice
there only appears to be one place where error_already_set is caught
within BPL - therefore couldn't I literally just do a find & replace
(or better, a #define throw_error_already_set
FXPython::int_throwPythonException() so I don't have problems with
merging new releases)
Cheers,
Niall
-----BEGIN PGP SIGNATURE-----
Version: idw's PGP-Frontend 4.9.6.1 / 9-2003 + PGP 8.0.2
iQA/AwUBP+CxBcEcvDLFGKbPEQLZ3gCfRUqDJN3hd8/XGaAPxyve7Nu7/y4An0Y7
Z01dYQKZXCp+snRhWg8NAfFF
=LbA/
-----END PGP SIGNATURE-----
More information about the Cplusplus-sig
mailing list