Salome HOME
PR: mergefrom_BR_BATCH_22Oct04
[modules/kernel.git] / src / Batch_SWIG / libBatch_Swig_exception.i
1 /*
2  * _exception.i : 
3  *
4  * Auteur : Ivan DUTKA-MALEN - EDF R&D
5  * Date   : Septembre 2003
6  * Projet : SALOME 2
7  *
8  */
9
10 %exception {
11     try {
12       $action
13     }
14     catch (GenericException & ex) {
15       string msg = ex.type + " : " + ex.message;
16       PyErr_SetString(PyExc_RuntimeWarning, msg.c_str());
17       return NULL;
18     }
19     catch (...) {
20       PyErr_SetString(PyExc_RuntimeWarning, "unknown exception");
21       return NULL;
22     }
23 }
24