diff --git a/src/Mod/Part/App/PartFeature.cpp b/src/Mod/Part/App/PartFeature.cpp index c1fc03c048..b98214131c 100644 --- a/src/Mod/Part/App/PartFeature.cpp +++ b/src/Mod/Part/App/PartFeature.cpp @@ -107,13 +107,19 @@ PyObject *Feature::getPyObject(void) std::vector Feature::getPySubObjects(const std::vector& NameVec) const { - std::vector temp; - for(std::vector::const_iterator it=NameVec.begin();it!=NameVec.end();++it){ - PyObject *obj = Shape.getShape().getPySubShape((*it).c_str()); - if(obj) - temp.push_back(obj); + try { + std::vector temp; + for(std::vector::const_iterator it=NameVec.begin();it!=NameVec.end();++it){ + PyObject *obj = Shape.getShape().getPySubShape((*it).c_str()); + if(obj) + temp.push_back(obj); + } + return temp; + } + catch (Standard_Failure) { + Handle(Standard_Failure) e = Standard_Failure::Caught(); + throw Py::ValueError(e->GetMessageString()); } - return temp; } void Feature::onChanged(const App::Property* prop)