Base: rename BaseExceptionFreeCADError to PyExc_FC_GeneralError

This commit is contained in:
wmayer
2022-03-17 14:45:48 +01:00
parent 1f12dca2b4
commit e4d1ed8366
29 changed files with 114 additions and 114 deletions

View File

@@ -410,9 +410,9 @@ static PyObject * s##DFUNC (PyObject *self, PyObject *args, PyObject * /*kwd*/){
*/
#define PYMETHODEDEF(FUNC) {"" #FUNC "",(PyCFunction) s##FUNC,Py_NEWARGS},
BaseExport extern PyObject* BaseExceptionFreeCADError;
#define PY_FCERROR (Base::BaseExceptionFreeCADError ? \
BaseExceptionFreeCADError : PyExc_RuntimeError)
BaseExport extern PyObject* PyExc_FC_GeneralError;
#define PY_FCERROR (Base::PyExc_FC_GeneralError ? \
PyExc_FC_GeneralError : PyExc_RuntimeError)
BaseExport extern PyObject* PyExc_FC_FreeCADAbort;
BaseExport extern PyObject* PyExc_FC_XMLBaseException;
@@ -433,14 +433,14 @@ BaseExport extern PyObject* PyExc_FC_CADKernelError;
* PYFUNCIMP_D(DocTypeStdPy,AddFeature)
* {
* char *pstr;
* if (!PyArg_ParseTuple(args, "s", &pstr)) // convert args: Python->C
* return NULL; // NULL triggers exception
* if (!PyArg_ParseTuple(args, "s", &pstr))
* return nullptr;
*
* try {
* Feature *pcFtr = _pcDocTypeStd->AddFeature(pstr);
* }catch(...) \
* { \
* Py_Error(Base::BaseExceptionFreeCADError,"Unknown C++ exception"); \
* Py_Error(Base::PyExc_FC_GeneralError,"Unknown C++ exception"); \
* }catch(FCException e) ..... // and so on.... \
* }
* \endcode
@@ -449,8 +449,8 @@ BaseExport extern PyObject* PyExc_FC_CADKernelError;
* PYFUNCIMP_D(DocTypeStdPy,AddFeature)
* {
* char *pstr;
* if (!PyArg_ParseTuple(args, "s", &pstr)) // convert args: Python->C
* return NULL; // NULL triggers exception
* if (!PyArg_ParseTuple(args, "s", &pstr))
* return nullptr;
*
* PY_TRY {
* Feature *pcFtr = _pcDocTypeStd->AddFeature(pstr);
@@ -469,12 +469,12 @@ BaseExport extern PyObject* PyExc_FC_CADKernelError;
{ \
auto pye = e.getPyExceptionType(); \
if(!pye) \
pye = Base::BaseExceptionFreeCADError; \
pye = Base::PyExc_FC_GeneralError; \
_Py_ErrorObj(R,pye,e.getPyObject()); \
} \
catch(const std::exception &e) \
{ \
_Py_Error(R,Base::BaseExceptionFreeCADError,e.what()); \
_Py_Error(R,Base::PyExc_FC_GeneralError, e.what()); \
} \
catch(const Py::Exception&) \
{ \
@@ -487,7 +487,7 @@ BaseExport extern PyObject* PyExc_FC_CADKernelError;
__PY_CATCH(R) \
catch(...) \
{ \
_Py_Error(R,Base::BaseExceptionFreeCADError,"Unknown C++ exception"); \
_Py_Error(R,Base::PyExc_FC_GeneralError,"Unknown C++ exception"); \
}
#else