Replace Base::Exception with appropriate subclass

This commit is contained in:
wmayer
2018-11-14 19:27:52 +01:00
parent d478c3057b
commit 21d01fe6fc
7 changed files with 34 additions and 37 deletions

View File

@@ -439,7 +439,7 @@ void PropertyConstraintList::setPathValue(const ObjectIdentifier &path, const bo
int index = c0.getIndex();
if (c0.getIndex() >= _lValueList.size())
throw Base::Exception("Array out of bounds");
throw Base::IndexError("Array out of bounds");
switch (_lValueList[index]->Type) {
case Angle:
dvalue = Base::toRadians<double>(dvalue);
@@ -473,7 +473,7 @@ void PropertyConstraintList::setPathValue(const ObjectIdentifier &path, const bo
}
}
}
throw Base::Exception("Invalid constraint");
throw Base::ValueError("Invalid constraint");
}
const Constraint * PropertyConstraintList::getConstraint(const ObjectIdentifier &path) const
@@ -482,7 +482,7 @@ const Constraint * PropertyConstraintList::getConstraint(const ObjectIdentifier
if (c0.isArray() && path.numSubComponents() == 1) {
if (c0.getIndex() >= _lValueList.size())
throw Base::Exception("Array out of bounds");
throw Base::IndexError("Array out of bounds");
return _lValueList[c0.getIndex()];
}
@@ -494,7 +494,7 @@ const Constraint * PropertyConstraintList::getConstraint(const ObjectIdentifier
return *it;
}
}
throw Base::Exception("Invalid constraint");
throw Base::ValueError("Invalid constraint");
}
const boost::any PropertyConstraintList::getPathValue(const ObjectIdentifier &path) const
@@ -518,7 +518,7 @@ const ObjectIdentifier PropertyConstraintList::canonicalPath(const ObjectIdentif
if (c1.isSimple())
return p;
}
throw Base::Exception("Invalid constraint");
throw Base::ValueError("Invalid constraint");
}
void PropertyConstraintList::getPaths(std::vector<ObjectIdentifier> &paths) const