App: do not hide actual exception type in DocumentObjectPy::addProperty/DocumentObjectPy::removeProperty

and throw TypeError in DynamicProperty::addDynamicProperty() if the based type id is invalid
This commit is contained in:
wmayer
2022-01-19 10:48:00 +01:00
parent 59b4f8d6d8
commit b9280ae760
3 changed files with 5 additions and 21 deletions

View File

@@ -183,7 +183,7 @@ Property* DynamicProperty::addDynamicProperty(PropertyContainer &pc, const char*
Base::Type propType = Base::Type::getTypeIfDerivedFrom(type, App::Property::getClassTypeId(), true);
if (propType.isBad()) {
FC_THROWM(Base::ValueError, "Invalid type "
FC_THROWM(Base::TypeError, "Invalid type "
<< type << " for property " << pc.getFullName() << '.' << name);
}