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

@@ -63,22 +63,22 @@ PyObject* GroupExtensionPy::addObject(PyObject *args)
DocumentObjectPy* docObj = static_cast<DocumentObjectPy*>(object);
if (!docObj->getDocumentObjectPtr() || !docObj->getDocumentObjectPtr()->getNameInDocument()) {
PyErr_SetString(Base::BaseExceptionFreeCADError, "Cannot add an invalid object");
PyErr_SetString(Base::PyExc_FC_GeneralError, "Cannot add an invalid object");
return nullptr;
}
if (docObj->getDocumentObjectPtr()->getDocument() != getGroupExtensionPtr()->getExtendedObject()->getDocument()) {
PyErr_SetString(Base::BaseExceptionFreeCADError, "Cannot add an object from another document to this group");
PyErr_SetString(Base::PyExc_FC_GeneralError, "Cannot add an object from another document to this group");
return nullptr;
}
if (docObj->getDocumentObjectPtr() == this->getGroupExtensionPtr()->getExtendedObject()) {
PyErr_SetString(Base::BaseExceptionFreeCADError, "Cannot add a group object to itself");
PyErr_SetString(Base::PyExc_FC_GeneralError, "Cannot add a group object to itself");
return nullptr;
}
if (docObj->getDocumentObjectPtr()->hasExtension(GroupExtension::getExtensionClassTypeId())) {
App::GroupExtension* docGrp = docObj->getDocumentObjectPtr()->getExtensionByType<GroupExtension>();
if (docGrp->hasObject(getGroupExtensionPtr()->getExtendedObject())) {
PyErr_SetString(Base::BaseExceptionFreeCADError, "Cannot add a group object to a child group");
PyErr_SetString(Base::PyExc_FC_GeneralError, "Cannot add a group object to a child group");
return nullptr;
}
}
@@ -175,11 +175,11 @@ PyObject* GroupExtensionPy::removeObject(PyObject *args)
DocumentObjectPy* docObj = static_cast<DocumentObjectPy*>(object);
if (!docObj->getDocumentObjectPtr() || !docObj->getDocumentObjectPtr()->getNameInDocument()) {
PyErr_SetString(Base::BaseExceptionFreeCADError, "Cannot remove an invalid object");
PyErr_SetString(Base::PyExc_FC_GeneralError, "Cannot remove an invalid object");
return nullptr;
}
if (docObj->getDocumentObjectPtr()->getDocument() != getGroupExtensionPtr()->getExtendedObject()->getDocument()) {
PyErr_SetString(Base::BaseExceptionFreeCADError, "Cannot remove an object from another document from this group");
PyErr_SetString(Base::PyExc_FC_GeneralError, "Cannot remove an object from another document from this group");
return nullptr;
}
@@ -263,11 +263,11 @@ PyObject* GroupExtensionPy::hasObject(PyObject *args)
DocumentObjectPy* docObj = static_cast<DocumentObjectPy*>(object);
if (!docObj->getDocumentObjectPtr() || !docObj->getDocumentObjectPtr()->getNameInDocument()) {
PyErr_SetString(Base::BaseExceptionFreeCADError, "Cannot check an invalid object");
PyErr_SetString(Base::PyExc_FC_GeneralError, "Cannot check an invalid object");
return nullptr;
}
if (docObj->getDocumentObjectPtr()->getDocument() != getGroupExtensionPtr()->getExtendedObject()->getDocument()) {
PyErr_SetString(Base::BaseExceptionFreeCADError, "Cannot check an object from another document with this group");
PyErr_SetString(Base::PyExc_FC_GeneralError, "Cannot check an object from another document with this group");
return nullptr;
}
if (recursivePy) {