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

@@ -201,7 +201,7 @@ void fixSketchSupport (Sketcher::SketchObject* sketch)
const App::Document* doc = sketch->getDocument();
PartDesign::Body *body = getBodyFor(sketch, /*messageIfNot*/ 0);
if (!body) {
throw Base::Exception ("Couldn't find body for the sketch");
throw Base::RuntimeError ("Couldn't find body for the sketch");
}
// Get the Origin for the body
@@ -226,7 +226,7 @@ void fixSketchSupport (Sketcher::SketchObject* sketch)
else if (sketchVector == Base::Vector3d(1,0,0))
plane = origin->getYZ ();
else {
throw Base::Exception("Sketch plane cannot be migrated");
throw Base::ValueError("Sketch plane cannot be migrated");
}
assert (plane);
@@ -324,7 +324,7 @@ void relinkToBody (PartDesign::Feature *feature) {
PartDesign::Body *body = PartDesign::Body::findBodyOf ( feature );
if (!body) {
throw Base::Exception ("Couldn't find body for the feature");
throw Base::RuntimeError ("Couldn't find body for the feature");
}
std::string bodyName = body->getNameInDocument ();