Base: rename BaseExceptionFreeCADError to PyExc_FC_GeneralError
This commit is contained in:
@@ -196,8 +196,8 @@ PyMOD_INIT_FUNC(Part)
|
||||
// Python exceptions
|
||||
//
|
||||
PyObject* OCCError = 0;
|
||||
if (PyObject_IsSubclass(Base::BaseExceptionFreeCADError, PyExc_RuntimeError)) {
|
||||
OCCError = PyErr_NewException("Part.OCCError", Base::BaseExceptionFreeCADError, NULL);
|
||||
if (PyObject_IsSubclass(Base::PyExc_FC_GeneralError, PyExc_RuntimeError)) {
|
||||
OCCError = PyErr_NewException("Part.OCCError", Base::PyExc_FC_GeneralError, NULL);
|
||||
}
|
||||
else {
|
||||
Base::Console().Error("Can not inherit Part.OCCError form BaseFreeCADError.\n");
|
||||
|
||||
@@ -79,7 +79,7 @@ int AttachEnginePy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
||||
if (!pNewAttacher) {
|
||||
std::stringstream errMsg;
|
||||
errMsg << "Object if this type is not derived from AttachEngine: " << typeName;
|
||||
PyErr_SetString(Base::BaseExceptionFreeCADError, errMsg.str().c_str());
|
||||
PyErr_SetString(Base::PyExc_FC_GeneralError, errMsg.str().c_str());
|
||||
return -1;
|
||||
}
|
||||
AttachEngine* oldAttacher = this->getAttachEnginePtr();
|
||||
@@ -250,7 +250,7 @@ Py::List AttachEnginePy::getImplementedModes(void) const
|
||||
PyErr_SetString(Part::PartExceptionOCCError, e.GetMessageString());\
|
||||
return NULL;\
|
||||
} catch (Base::Exception &e) {\
|
||||
PyErr_SetString(Base::BaseExceptionFreeCADError, e.what());\
|
||||
PyErr_SetString(Base::PyExc_FC_GeneralError, e.what());\
|
||||
return NULL;\
|
||||
} catch (const Py::Exception &){\
|
||||
return NULL;\
|
||||
|
||||
@@ -572,7 +572,7 @@ PyObject* TopoShapePy::__getstate__(PyObject *args) {
|
||||
|
||||
PyObject* TopoShapePy::__setstate__(PyObject *args) {
|
||||
if (! getTopoShapePtr()) {
|
||||
PyErr_SetString(Base::BaseExceptionFreeCADError,"no c++ object");
|
||||
PyErr_SetString(Base::PyExc_FC_GeneralError,"no c++ object");
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
@@ -2926,7 +2926,7 @@ Py::String TopoShapePy::getShapeType(void) const
|
||||
{
|
||||
TopoDS_Shape sh = getTopoShapePtr()->getShape();
|
||||
if (sh.IsNull())
|
||||
throw Py::Exception(Base::BaseExceptionFreeCADError, "cannot determine type of null shape");
|
||||
throw Py::Exception(Base::PyExc_FC_GeneralError, "cannot determine type of null shape");
|
||||
TopAbs_ShapeEnum type = sh.ShapeType();
|
||||
std::string name;
|
||||
switch (type)
|
||||
@@ -2967,7 +2967,7 @@ Py::String TopoShapePy::getOrientation(void) const
|
||||
{
|
||||
TopoDS_Shape sh = getTopoShapePtr()->getShape();
|
||||
if (sh.IsNull())
|
||||
throw Py::Exception(Base::BaseExceptionFreeCADError, "cannot determine orientation of null shape");
|
||||
throw Py::Exception(Base::PyExc_FC_GeneralError, "cannot determine orientation of null shape");
|
||||
TopAbs_Orientation type = sh.Orientation();
|
||||
std::string name;
|
||||
switch (type)
|
||||
@@ -2993,7 +2993,7 @@ void TopoShapePy::setOrientation(Py::String arg)
|
||||
{
|
||||
TopoDS_Shape sh = getTopoShapePtr()->getShape();
|
||||
if (sh.IsNull())
|
||||
throw Py::Exception(Base::BaseExceptionFreeCADError, "cannot determine orientation of null shape");
|
||||
throw Py::Exception(Base::PyExc_FC_GeneralError, "cannot determine orientation of null shape");
|
||||
std::string name = (std::string)arg;
|
||||
TopAbs_Orientation type;
|
||||
if (name == "Forward") {
|
||||
|
||||
Reference in New Issue
Block a user