[C++-sig] Exception not caught

Pierre Barbier de Reuille pierre.barbier at cirad.fr
Tue Mar 23 16:11:25 CET 2004


Hello,

I've registred an exception :

struct ObjectCreationException
{ };

with the following function :


void obj_create_trans( const ObjectCreationException& err )
{
  PyErr_SetString( PyExc_UserWarning, "Error when creating object, see
standard error for more information" );
}

and in the module definition :

boost::python::register_exception_translator<ObjectCreationException>(&obj_create_trans);

But, when my C++ program throw this exception, the program just abort.
What can be the problem ?

Thanks,

Pierre

-- 
Pierre Barbier de Reuille

INRA - UMR Cirad/Inra/Cnrs/Univ.MontpellierII AMAP
Botanique et Bio-informatique de l'Architecture des Plantes
TA40/PSII, Boulevard de la Lironde
34398 MONTPELLIER CEDEX 5, France

tel   : (33) 4 67 61 65 77    fax   : (33) 4 67 61 56 68 





More information about the Cplusplus-sig mailing list