+ in setPyObject() only use classes derived from Base::Exception

This commit is contained in:
wmayer
2013-07-05 15:29:04 +02:00
parent 9729270c65
commit 609072f140
14 changed files with 196 additions and 64 deletions

View File

@@ -113,7 +113,7 @@ void PropertyFemMesh::setPyObject(PyObject *value)
else {
std::string error = std::string("type must be 'FemMesh', not ");
error += value->ob_type->tp_name;
throw Py::TypeError(error);
throw Base::TypeError(error);
}
}

View File

@@ -261,7 +261,7 @@ PyObject* PropertyCurvatureList::getPyObject(void)
void PropertyCurvatureList::setPyObject(PyObject *value)
{
throw Py::AttributeError(std::string("This attribute is read-only"));
throw Base::AttributeError(std::string("This attribute is read-only"));
}
App::Property *PropertyCurvatureList::Copy(void) const
@@ -430,7 +430,7 @@ void PropertyMeshKernel::setPyObject(PyObject *value)
else {
std::string error = std::string("type must be 'Mesh', not ");
error += value->ob_type->tp_name;
throw Py::TypeError(error);
throw Base::TypeError(error);
}
}

View File

@@ -123,7 +123,7 @@ void PropertyGeometryList::setPyObject(PyObject *value)
if (!PyObject_TypeCheck(item, &(GeometryPy::Type))) {
std::string error = std::string("types in list must be 'Geometry', not ");
error += item->ob_type->tp_name;
throw Py::TypeError(error);
throw Base::TypeError(error);
}
values[i] = static_cast<GeometryPy*>(item)->getGeometryPtr();
@@ -138,7 +138,7 @@ void PropertyGeometryList::setPyObject(PyObject *value)
else {
std::string error = std::string("type must be 'Geometry' or list of 'Geometry', not ");
error += value->ob_type->tp_name;
throw Py::TypeError(error);
throw Base::TypeError(error);
}
}

View File

@@ -200,7 +200,7 @@ void PropertyPartShape::setPyObject(PyObject *value)
else {
std::string error = std::string("type must be 'Shape', not ");
error += value->ob_type->tp_name;
throw Py::TypeError(error);
throw Base::TypeError(error);
}
}

View File

@@ -99,7 +99,7 @@ void PropertyPointKernel::setPyObject(PyObject *value)
else {
std::string error = std::string("type must be 'Points', not ");
error += value->ob_type->tp_name;
throw Py::TypeError(error);
throw Base::TypeError(error);
}
}

View File

@@ -106,7 +106,7 @@ void PropertyTrajectory::setPyObject(PyObject *value)
else {
std::string error = std::string("type must be 'Trajectory', not ");
error += value->ob_type->tp_name;
throw Py::TypeError(error);
throw Base::TypeError(error);
}
}

View File

@@ -126,7 +126,7 @@ void PropertyConstraintList::setPyObject(PyObject *value)
if (!PyObject_TypeCheck(item, &(ConstraintPy::Type))) {
std::string error = std::string("types in list must be 'Constraint', not ");
error += item->ob_type->tp_name;
throw Py::TypeError(error);
throw Base::TypeError(error);
}
values[i] = static_cast<ConstraintPy*>(item)->getConstraintPtr();
@@ -141,7 +141,7 @@ void PropertyConstraintList::setPyObject(PyObject *value)
else {
std::string error = std::string("type must be 'Constraint' or list of 'Constraint', not ");
error += value->ob_type->tp_name;
throw Py::TypeError(error);
throw Base::TypeError(error);
}
}