Replace Base::Exception with appropriate subclass

This commit is contained in:
wmayer
2018-11-14 19:28:00 +01:00
parent 21d01fe6fc
commit 00de5bb7ad
23 changed files with 116 additions and 115 deletions

View File

@@ -266,7 +266,7 @@ Body* Body::findBodyOf(const App::DocumentObject* feature)
std::vector<App::DocumentObject*> Body::addObject(App::DocumentObject *feature)
{
if(!isAllowed(feature))
throw Base::Exception("Body: object is not allowed");
throw Base::ValueError("Body: object is not allowed");
//TODO: features should not add all links
@@ -299,7 +299,7 @@ std::vector< App::DocumentObject* > Body::addObjects(std::vector< App::DocumentO
void Body::insertObject(App::DocumentObject* feature, App::DocumentObject* target, bool after)
{
if (target && !hasObject (target)) {
throw Base::Exception("Body: the feature we should insert relative to is not part of that body");
throw Base::ValueError("Body: the feature we should insert relative to is not part of that body");
}
//ensure that all origin links are ok