diff --git a/src/App/ApplicationPy.cpp b/src/App/ApplicationPy.cpp index e04d5032b..03972ced6 100644 --- a/src/App/ApplicationPy.cpp +++ b/src/App/ApplicationPy.cpp @@ -260,7 +260,7 @@ PyObject* Application::sSaveDocument(PyObject * /*self*/, PyObject *args,PyObjec Document* doc = GetApplication().getDocument(pDoc); if ( doc ) { if ( doc->save() == false ) { - PyErr_Format(PyExc_Exception, "Cannot save document '%s'", pDoc); + PyErr_Format(Base::BaseExceptionFreeCADError, "Cannot save document '%s'", pDoc); return 0L; } } diff --git a/src/App/DocumentObjectGroupPyImp.cpp b/src/App/DocumentObjectGroupPyImp.cpp index 105c7c0b5..d12d91b7d 100644 --- a/src/App/DocumentObjectGroupPyImp.cpp +++ b/src/App/DocumentObjectGroupPyImp.cpp @@ -50,7 +50,7 @@ PyObject* DocumentObjectGroupPy::newObject(PyObject *args) return object->getPyObject(); } else { - PyErr_Format(PyExc_Exception, "Cannot create object of type '%s'", sType); + PyErr_Format(Base::BaseExceptionFreeCADError, "Cannot create object of type '%s'", sType); return NULL; } } diff --git a/src/App/DocumentPyImp.cpp b/src/App/DocumentPyImp.cpp index 9c659d817..fe8a33368 100644 --- a/src/App/DocumentPyImp.cpp +++ b/src/App/DocumentPyImp.cpp @@ -202,7 +202,7 @@ PyObject* DocumentPy::addObject(PyObject *args) else { std::stringstream str; str << "No document object found of type '" << sType << "'" << std::ends; - throw Py::Exception(PyExc_Exception,str.str()); + throw Py::Exception(Base::BaseExceptionFreeCADError,str.str()); } } @@ -220,7 +220,7 @@ PyObject* DocumentPy::removeObject(PyObject *args) } else { std::stringstream str; str << "No document object found with name '" << sName << "'" << std::ends; - throw Py::Exception(PyExc_Exception,str.str()); + throw Py::Exception(Base::BaseExceptionFreeCADError,str.str()); } } @@ -239,7 +239,7 @@ PyObject* DocumentPy::copyObject(PyObject *args) } else { std::string str("Failed to copy the object"); - throw Py::Exception(PyExc_Exception,str); + throw Py::Exception(Base::BaseExceptionFreeCADError,str); } } @@ -256,7 +256,7 @@ PyObject* DocumentPy::moveObject(PyObject *args) } else { std::string str("Failed to move the object"); - throw Py::Exception(PyExc_Exception,str); + throw Py::Exception(Base::BaseExceptionFreeCADError,str); } } @@ -358,12 +358,12 @@ PyObject* DocumentPy::findObjects(PyObject *args) Base::Type type = Base::Type::fromName(sType); if (type == Base::Type::badType()) { - PyErr_Format(PyExc_Exception, "'%s' is not a valid type", sType); + PyErr_Format(Base::BaseExceptionFreeCADError, "'%s' is not a valid type", sType); return NULL; } if (!type.isDerivedFrom(App::DocumentObject::getClassTypeId())) { - PyErr_Format(PyExc_Exception, "Type '%s' does not inherit from 'App::DocumentObject'", sType); + PyErr_Format(Base::BaseExceptionFreeCADError, "Type '%s' does not inherit from 'App::DocumentObject'", sType); return NULL; } diff --git a/src/App/FeaturePythonPyImp.inl b/src/App/FeaturePythonPyImp.inl index d0a5a9e77..a9f7225e0 100644 --- a/src/App/FeaturePythonPyImp.inl +++ b/src/App/FeaturePythonPyImp.inl @@ -342,7 +342,7 @@ PyObject* FeaturePythonPyT::addProperty(PyObject *args) if (!prop) { std::stringstream str; str << "No property found of type '" << sType << "'" << std::ends; - throw Py::Exception(PyExc_Exception,str.str()); + throw Py::Exception(Base::BaseExceptionFreeCADError,str.str()); } return Py::new_reference_to(this); diff --git a/src/Base/Console.cpp b/src/Base/Console.cpp index c4423cf6c..97d371e73 100644 --- a/src/Base/Console.cpp +++ b/src/Base/Console.cpp @@ -572,12 +572,12 @@ PyObject *ConsoleSingleton::sPySetStatus(PyObject * /*self*/, PyObject *args, Py else if(strcmp(pstr2,"Err") == 0) pObs->bErr = (Bool==0)?false:true; else - Py_Error(PyExc_Exception,"Unknown Message Type (use Log,Err,Msg or Wrn)"); + Py_Error(Base::BaseExceptionFreeCADError,"Unknown Message Type (use Log,Err,Msg or Wrn)"); Py_INCREF(Py_None); return Py_None; } else { - Py_Error(PyExc_Exception,"Unknown Console Type"); + Py_Error(Base::BaseExceptionFreeCADError,"Unknown Console Type"); } } PY_CATCH; diff --git a/src/Base/PyObjectBase.h b/src/Base/PyObjectBase.h index cffd90fa5..e2350e178 100644 --- a/src/Base/PyObjectBase.h +++ b/src/Base/PyObjectBase.h @@ -397,7 +397,7 @@ BaseExport extern PyObject* BaseExceptionFreeCADError; * Feature *pcFtr = _pcDocTypeStd->AddFeature(pstr); * }catch(...) \ * { \ - * Py_Error(PyExc_Exception,"Unknown C++ exception"); \ + * Py_Error(Base::BaseExceptionFreeCADError,"Unknown C++ exception"); \ * }catch(FCException e) ..... // and so on.... \ * } * \endcode diff --git a/src/Gui/ApplicationPy.cpp b/src/Gui/ApplicationPy.cpp index 7f994190e..032abfa8d 100644 --- a/src/Gui/ApplicationPy.cpp +++ b/src/Gui/ApplicationPy.cpp @@ -838,7 +838,7 @@ PyObject* Application::sRunCommand(PyObject * /*self*/, PyObject *args,PyObject return Py_None; } else { - PyErr_Format(PyExc_Exception, "No such command '%s'", pName); + PyErr_Format(Base::BaseExceptionFreeCADError, "No such command '%s'", pName); return 0; } } diff --git a/src/Gui/DocumentPyImp.cpp b/src/Gui/DocumentPyImp.cpp index ec5af663b..06d081748 100644 --- a/src/Gui/DocumentPyImp.cpp +++ b/src/Gui/DocumentPyImp.cpp @@ -106,13 +106,13 @@ PyObject* DocumentPy::setEdit(PyObject *args) return NULL; // NULL triggers exception App::DocumentObject * obj = getDocumentPtr()->getDocument()->getObject(psFeatStr); if (!obj) { - PyErr_Format(PyExc_Exception, "No such object found in document: '%s'", psFeatStr); + PyErr_Format(Base::BaseExceptionFreeCADError, "No such object found in document: '%s'", psFeatStr); return 0; } bool ok = getDocumentPtr()->setEdit(getDocumentPtr()->getViewProvider(obj),mod); if (!ok) { - PyErr_Format(PyExc_Exception, "Failed to set object '%s' in edit mode", psFeatStr); + PyErr_Format(Base::BaseExceptionFreeCADError, "Failed to set object '%s' in edit mode", psFeatStr); return 0; } @@ -227,7 +227,7 @@ PyObject* DocumentPy::mdiViewsOfType(PyObject *args) Base::Type type = Base::Type::fromName(sType); if (type == Base::Type::badType()) { - PyErr_Format(PyExc_Exception, "'%s' is not a valid type", sType); + PyErr_Format(Base::BaseExceptionFreeCADError, "'%s' is not a valid type", sType); return NULL; } diff --git a/src/Gui/ViewProviderPythonFeaturePyImp.cpp b/src/Gui/ViewProviderPythonFeaturePyImp.cpp index ddd2816a4..05acd7e1b 100644 --- a/src/Gui/ViewProviderPythonFeaturePyImp.cpp +++ b/src/Gui/ViewProviderPythonFeaturePyImp.cpp @@ -79,7 +79,7 @@ PyObject* ViewProviderPythonFeaturePy::addProperty(PyObject *args) if (!prop) { std::stringstream str; str << "No property found of type '" << sType << "'" << std::ends; - throw Py::Exception(PyExc_Exception,str.str()); + throw Py::Exception(Base::BaseExceptionFreeCADError,str.str()); } return Py::new_reference_to(this); diff --git a/src/Main/FreeCADGuiPy.cpp b/src/Main/FreeCADGuiPy.cpp index 5ef2ecbff..927d64ff6 100644 --- a/src/Main/FreeCADGuiPy.cpp +++ b/src/Main/FreeCADGuiPy.cpp @@ -271,7 +271,7 @@ QWidget* setupMainWindow() Base::Interpreter().runString(Base::ScriptFactory().ProduceScript("FreeCADGuiInit")); } catch (const Base::Exception& e) { - PyErr_Format(PyExc_Exception, "Error in FreeCADGuiInit.py: %s\n", e.what()); + PyErr_Format(Base::BaseExceptionFreeCADError, "Error in FreeCADGuiInit.py: %s\n", e.what()); return 0; } init = true; diff --git a/src/Mod/Image/Gui/AppImageGuiPy.cpp b/src/Mod/Image/Gui/AppImageGuiPy.cpp index 90e9d95fb..bad51ec84 100644 --- a/src/Mod/Image/Gui/AppImageGuiPy.cpp +++ b/src/Mod/Image/Gui/AppImageGuiPy.cpp @@ -72,7 +72,7 @@ open(PyObject *self, PyObject *args) } } else - Py_Error(PyExc_Exception,"Could not load image"); + Py_Error(Base::BaseExceptionFreeCADError,"Could not load image"); // Displaying the image in a view. // This ImageView object takes ownership of the pixel data (in 'pointImageTo') so we don't need to delete it here diff --git a/src/Mod/JtReader/App/AppJtReaderPy.cpp b/src/Mod/JtReader/App/AppJtReaderPy.cpp index e56071f6e..9011f0168 100644 --- a/src/Mod/JtReader/App/AppJtReaderPy.cpp +++ b/src/Mod/JtReader/App/AppJtReaderPy.cpp @@ -101,7 +101,7 @@ open(PyObject *self, PyObject *args) // extract ending if(file.extension() == "") - Py_Error(PyExc_Exception,"no file ending"); + Py_Error(Base::BaseExceptionFreeCADError,"no file ending"); if(file.hasExtension("jt")) { @@ -140,7 +140,7 @@ open(PyObject *self, PyObject *args) } else { - Py_Error(PyExc_Exception,"unknown file ending"); + Py_Error(Base::BaseExceptionFreeCADError,"unknown file ending"); } @@ -165,7 +165,7 @@ insert(PyObject *self, PyObject *args) // extract ending if(file.extension() == "") - Py_Error(PyExc_Exception,"no file ending"); + Py_Error(Base::BaseExceptionFreeCADError,"no file ending"); if(file.hasExtension("jt") ) { @@ -175,7 +175,7 @@ insert(PyObject *self, PyObject *args) { char szBuf[200]; snprintf(szBuf, 200, "Import called to the non-existing document '%s'", DocName); - Py_Error(PyExc_Exception,szBuf); + Py_Error(Base::BaseExceptionFreeCADError,szBuf); } readFile(Name,0); @@ -211,13 +211,13 @@ insert(PyObject *self, PyObject *args) }else{ clearData(); - //Py_Error(PyExc_Exception,"No Mesh in file"); + //Py_Error(Base::BaseExceptionFreeCADError,"No Mesh in file"); Base::Console().Warning("No Mesh in file: %s\n",Name); } } else { - Py_Error(PyExc_Exception,"unknown file ending"); + Py_Error(Base::BaseExceptionFreeCADError,"unknown file ending"); } } PY_CATCH; diff --git a/src/Mod/Mesh/App/MeshPyImp.cpp b/src/Mod/Mesh/App/MeshPyImp.cpp index d317522a8..204fe07d2 100644 --- a/src/Mod/Mesh/App/MeshPyImp.cpp +++ b/src/Mod/Mesh/App/MeshPyImp.cpp @@ -1252,14 +1252,14 @@ PyObject* MeshPy::collapseFacets(PyObject *args) facets.push_back(iIdx); } else { - Py_Error(PyExc_Exception, "list of integers needed"); + Py_Error(Base::BaseExceptionFreeCADError, "list of integers needed"); } } getMeshObjectPtr()->collapseFacets(facets); } else { - Py_Error(PyExc_Exception, "List of Integers needed"); + Py_Error(Base::BaseExceptionFreeCADError, "List of Integers needed"); } Py_Return; diff --git a/src/Mod/MeshPart/App/AppMeshPartPy.cpp b/src/Mod/MeshPart/App/AppMeshPartPy.cpp index 71e395493..ddb836c31 100644 --- a/src/Mod/MeshPart/App/AppMeshPartPy.cpp +++ b/src/Mod/MeshPart/App/AppMeshPartPy.cpp @@ -55,17 +55,17 @@ loftOnCurve(PyObject *self, PyObject *args) std::vector poly; if (!PyList_Check(pcListObj)) - Py_Error(PyExc_Exception,"List of Tuble of three or two floats needed as second parameter!"); + Py_Error(Base::BaseExceptionFreeCADError,"List of Tuble of three or two floats needed as second parameter!"); int nSize = PyList_Size(pcListObj); for (int i=0; irecompute(); } catch (const Base::Exception& e) { - Py_Error(PyExc_Exception, e.what()); + Py_Error(Base::BaseExceptionFreeCADError, e.what()); } } } PY_CATCH_OCC; @@ -208,7 +208,7 @@ static PyObject * insert(PyObject *self, PyObject *args) // extract ending if (file.extension() == "") - Py_Error(PyExc_Exception,"no file ending"); + Py_Error(Base::BaseExceptionFreeCADError,"no file ending"); App::Document *pcDoc = App::GetApplication().getDocument(DocName); if (!pcDoc) { pcDoc = App::GetApplication().newDocument(DocName); @@ -241,7 +241,7 @@ static PyObject * insert(PyObject *self, PyObject *args) pcDoc->recompute(); } catch (const Base::Exception& e) { - Py_Error(PyExc_Exception, e.what()); + Py_Error(Base::BaseExceptionFreeCADError, e.what()); } } } PY_CATCH_OCC; diff --git a/src/Mod/Part/App/TopoShapePyImp.cpp b/src/Mod/Part/App/TopoShapePyImp.cpp index 8d261277b..1fdf6b8a8 100644 --- a/src/Mod/Part/App/TopoShapePyImp.cpp +++ b/src/Mod/Part/App/TopoShapePyImp.cpp @@ -1763,7 +1763,7 @@ Py::String TopoShapePy::getShapeType(void) const { TopoDS_Shape sh = getTopoShapePtr()->_Shape; if (sh.IsNull()) - throw Py::Exception(PyExc_Exception, "cannot determine type of null shape"); + throw Py::Exception(Base::BaseExceptionFreeCADError, "cannot determine type of null shape"); TopAbs_ShapeEnum type = sh.ShapeType(); std::string name; switch (type) @@ -1804,7 +1804,7 @@ Py::String TopoShapePy::getOrientation(void) const { TopoDS_Shape sh = getTopoShapePtr()->_Shape; if (sh.IsNull()) - throw Py::Exception(PyExc_Exception, "cannot determine orientation of null shape"); + throw Py::Exception(Base::BaseExceptionFreeCADError, "cannot determine orientation of null shape"); TopAbs_Orientation type = sh.Orientation(); std::string name; switch (type) @@ -1830,7 +1830,7 @@ void TopoShapePy::setOrientation(Py::String arg) { TopoDS_Shape& sh = getTopoShapePtr()->_Shape; if (sh.IsNull()) - throw Py::Exception(PyExc_Exception, "cannot determine orientation of null shape"); + throw Py::Exception(Base::BaseExceptionFreeCADError, "cannot determine orientation of null shape"); std::string name = (std::string)arg; TopAbs_Orientation type; if (name == "Forward") { diff --git a/src/Mod/Points/App/AppPointsPy.cpp b/src/Mod/Points/App/AppPointsPy.cpp index 190849636..a7895207f 100644 --- a/src/Mod/Points/App/AppPointsPy.cpp +++ b/src/Mod/Points/App/AppPointsPy.cpp @@ -62,7 +62,7 @@ open(PyObject *self, PyObject *args) // extract ending if (file.extension() == "") - Py_Error(PyExc_Exception,"no file ending"); + Py_Error(Base::BaseExceptionFreeCADError,"no file ending"); if (file.hasExtension("asc")) { // create new document and add Import feature @@ -90,7 +90,7 @@ open(PyObject *self, PyObject *args) } #endif else { - Py_Error(PyExc_Exception,"unknown file ending"); + Py_Error(Base::BaseExceptionFreeCADError,"unknown file ending"); } } PY_CATCH; @@ -111,7 +111,7 @@ insert(PyObject *self, PyObject *args) // extract ending if (file.extension() == "") - Py_Error(PyExc_Exception,"no file ending"); + Py_Error(Base::BaseExceptionFreeCADError,"no file ending"); if (file.hasExtension("asc")) { // add Import feature @@ -145,7 +145,7 @@ insert(PyObject *self, PyObject *args) } #endif else { - Py_Error(PyExc_Exception,"unknown file ending"); + Py_Error(Base::BaseExceptionFreeCADError,"unknown file ending"); } } PY_CATCH; diff --git a/src/Mod/Raytracing/App/AppRaytracingPy.cpp b/src/Mod/Raytracing/App/AppRaytracingPy.cpp index cee2f6659..d7020adb5 100644 --- a/src/Mod/Raytracing/App/AppRaytracingPy.cpp +++ b/src/Mod/Raytracing/App/AppRaytracingPy.cpp @@ -185,7 +185,7 @@ writeCameraFile(PyObject *self, PyObject *args) for(int i=0;i<4;i++) { // check the right size of the Tuple of floats if(PyTuple_GET_SIZE(Arg[i]) != 3) - Py_Error(PyExc_Exception,"Wrong parameter format, four Tuple of three floats needed!"); + Py_Error(Base::BaseExceptionFreeCADError,"Wrong parameter format, four Tuple of three floats needed!"); // go through the Tuple of floats for(int l=0;l<3;l++) { @@ -198,7 +198,7 @@ writeCameraFile(PyObject *self, PyObject *args) else if (PyInt_Check(temp)) vecs[i][l] = (double) PyInt_AsLong(temp); else - Py_Error(PyExc_Exception,"Wrong parameter format, four Tuple of three floats needed!"); + Py_Error(Base::BaseExceptionFreeCADError,"Wrong parameter format, four Tuple of three floats needed!"); } } diff --git a/src/Mod/Robot/App/TrajectoryPyImp.cpp b/src/Mod/Robot/App/TrajectoryPyImp.cpp index 514d05499..773ccbee4 100644 --- a/src/Mod/Robot/App/TrajectoryPyImp.cpp +++ b/src/Mod/Robot/App/TrajectoryPyImp.cpp @@ -112,7 +112,7 @@ PyObject* TrajectoryPy::insertWaypoints(PyObject * args) return new TrajectoryPy(new Robot::Trajectory(*getTrajectoryPtr())); } - Py_Error(PyExc_Exception, "Wrong parameters - waypoint or placement expected"); + Py_Error(Base::BaseExceptionFreeCADError, "Wrong parameters - waypoint or placement expected"); } diff --git a/src/Mod/Sketcher/App/AppSketcherPy.cpp b/src/Mod/Sketcher/App/AppSketcherPy.cpp index b447d8514..348eb709c 100644 --- a/src/Mod/Sketcher/App/AppSketcherPy.cpp +++ b/src/Mod/Sketcher/App/AppSketcherPy.cpp @@ -61,7 +61,7 @@ static PyObject * open(PyObject *self, PyObject *args) // extract ending if (file.extension() == "") - Py_Error(PyExc_Exception,"no file ending"); + Py_Error(Base::BaseExceptionFreeCADError,"no file ending"); //if (file.hasExtension("igs") || file.hasExtension("iges")) { // // create new document and add Import feature @@ -71,7 +71,7 @@ static PyObject * open(PyObject *self, PyObject *args) // pcDoc->recompute(); //} // else { - Py_Error(PyExc_Exception,"unknown file ending"); + Py_Error(Base::BaseExceptionFreeCADError,"unknown file ending"); //} Py_Return; @@ -91,7 +91,7 @@ static PyObject * insert(PyObject *self, PyObject *args) // extract ending if (file.extension() == "") - Py_Error(PyExc_Exception,"no file ending"); + Py_Error(Base::BaseExceptionFreeCADError,"no file ending"); App::Document *pcDoc = App::GetApplication().getDocument(DocName); if (!pcDoc) { pcDoc = App::GetApplication().newDocument(DocName); @@ -105,7 +105,7 @@ static PyObject * insert(PyObject *self, PyObject *args) pcDoc->recompute(); } else { - Py_Error(PyExc_Exception,"unknown file ending"); + Py_Error(Base::BaseExceptionFreeCADError,"unknown file ending"); } } PY_CATCH; diff --git a/src/Tools/generateTemplates/templateClassPyExport.py b/src/Tools/generateTemplates/templateClassPyExport.py index 08a1a4a10..380f942c1 100644 --- a/src/Tools/generateTemplates/templateClassPyExport.py +++ b/src/Tools/generateTemplates/templateClassPyExport.py @@ -473,7 +473,7 @@ PyObject * @self.export.Name@::staticCallback_@i.Name@ (PyObject *self, PyObject str += e.what(); str += ")"; e.ReportException(); - PyErr_SetString(PyExc_Exception,str.c_str()); + PyErr_SetString(Base::BaseExceptionFreeCADError,str.c_str()); return NULL; } catch(const boost::filesystem::filesystem_error& e) // catch boost filesystem exception @@ -485,7 +485,7 @@ PyObject * @self.export.Name@::staticCallback_@i.Name@ (PyObject *self, PyObject str += e.what(); str += ")\\n"; Base::Console().Error(str.c_str()); - PyErr_SetString(PyExc_Exception,str.c_str()); + PyErr_SetString(Base::BaseExceptionFreeCADError,str.c_str()); return NULL; } catch(const Py::Exception&) @@ -496,7 +496,7 @@ PyObject * @self.export.Name@::staticCallback_@i.Name@ (PyObject *self, PyObject catch(const char* e) // catch simple string exceptions { Base::Console().Error(e); - PyErr_SetString(PyExc_Exception,e); + PyErr_SetString(Base::BaseExceptionFreeCADError,e); return NULL; } // in debug not all exceptions will be catched to get the attention of the developer! @@ -508,12 +508,12 @@ PyObject * @self.export.Name@::staticCallback_@i.Name@ (PyObject *self, PyObject str += e.what(); str += ")"; Base::Console().Error(str.c_str()); - PyErr_SetString(PyExc_Exception,str.c_str()); + PyErr_SetString(Base::BaseExceptionFreeCADError,str.c_str()); return NULL; } catch(...) // catch the rest! { - PyErr_SetString(PyExc_Exception,"Unknown C++ exception"); + PyErr_SetString(Base::BaseExceptionFreeCADError,"Unknown C++ exception"); return NULL; } #endif @@ -537,7 +537,7 @@ PyObject * @self.export.Name@::staticCallback_get@i.Name@ (PyObject *self, void // The exception text is already set return NULL; } catch (...) { - PyErr_SetString(PyExc_Exception, "Unknown exception while reading attribute '@i.Name@' of object '@self.export.Twin@'"); + PyErr_SetString(Base::BaseExceptionFreeCADError, "Unknown exception while reading attribute '@i.Name@' of object '@self.export.Twin@'"); return NULL; } } @@ -576,7 +576,7 @@ int @self.export.Name@::staticCallback_set@i.Name@ (PyObject *self, PyObject *va // The exception text is already set return -1; } catch (...) { - PyErr_SetString(PyExc_Exception, "Unknown exception while writing attribute '@i.Name@' of object '@self.export.Twin@'"); + PyErr_SetString(Base::BaseExceptionFreeCADError, "Unknown exception while writing attribute '@i.Name@' of object '@self.export.Twin@'"); return -1; } } @@ -658,7 +658,7 @@ PyObject *@self.export.Name@::_getattr(char *attr) // __getattr__ function: n str += e.what(); str += ")"; e.ReportException(); - PyErr_SetString(PyExc_Exception,str.c_str()); + PyErr_SetString(Base::BaseExceptionFreeCADError,str.c_str()); return NULL; } catch(const std::exception& e) // catch other c++ exceptions @@ -668,7 +668,7 @@ PyObject *@self.export.Name@::_getattr(char *attr) // __getattr__ function: n str += e.what(); str += ")"; Base::Console().Error(str.c_str()); - PyErr_SetString(PyExc_Exception,str.c_str()); + PyErr_SetString(Base::BaseExceptionFreeCADError,str.c_str()); return NULL; } catch(const Py::Exception&) @@ -678,7 +678,7 @@ PyObject *@self.export.Name@::_getattr(char *attr) // __getattr__ function: n } catch(...) // catch the rest! { - PyErr_SetString(PyExc_Exception,"Unknown C++ exception"); + PyErr_SetString(Base::BaseExceptionFreeCADError,"Unknown C++ exception"); return NULL; } #else // DONT_CATCH_CXX_EXCEPTIONS @@ -689,7 +689,7 @@ PyObject *@self.export.Name@::_getattr(char *attr) // __getattr__ function: n str += e.what(); str += ")"; e.ReportException(); - PyErr_SetString(PyExc_Exception,str.c_str()); + PyErr_SetString(Base::BaseExceptionFreeCADError,str.c_str()); return NULL; } catch(const Py::Exception&) @@ -726,7 +726,7 @@ int @self.export.Name@::_setattr(char *attr, PyObject *value) // __setattr__ fu str += e.what(); str += ")"; e.ReportException(); - PyErr_SetString(PyExc_Exception,str.c_str()); + PyErr_SetString(Base::BaseExceptionFreeCADError,str.c_str()); return -1; } catch(const std::exception& e) // catch other c++ exceptions @@ -736,7 +736,7 @@ int @self.export.Name@::_setattr(char *attr, PyObject *value) // __setattr__ fu str += e.what(); str += ")"; Base::Console().Error(str.c_str()); - PyErr_SetString(PyExc_Exception,str.c_str()); + PyErr_SetString(Base::BaseExceptionFreeCADError,str.c_str()); return -1; } catch(const Py::Exception&) @@ -746,7 +746,7 @@ int @self.export.Name@::_setattr(char *attr, PyObject *value) // __setattr__ fu } catch(...) // catch the rest! { - PyErr_SetString(PyExc_Exception,"Unknown C++ exception"); + PyErr_SetString(Base::BaseExceptionFreeCADError,"Unknown C++ exception"); return -1; } #else // DONT_CATCH_CXX_EXCEPTIONS @@ -757,7 +757,7 @@ int @self.export.Name@::_setattr(char *attr, PyObject *value) // __setattr__ fu str += e.what(); str += ")"; e.ReportException(); - PyErr_SetString(PyExc_Exception,str.c_str()); + PyErr_SetString(Base::BaseExceptionFreeCADError,str.c_str()); return -1; } catch(const Py::Exception&)