issue #1700 replace PyExc_Exception

This commit is contained in:
Sebastian Hoogen
2014-08-29 21:12:45 +02:00
committed by wmayer
parent 1bc2e5d430
commit d49528b27e
21 changed files with 64 additions and 64 deletions

View File

@@ -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;
}
}

View File

@@ -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;
}
}

View File

@@ -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;
}

View File

@@ -342,7 +342,7 @@ PyObject* FeaturePythonPyT<FeaturePyT>::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);