Replace Base::Exception with appropriate subclass

This commit is contained in:
wmayer
2018-11-14 19:45:20 +01:00
parent d7ec2b1368
commit 9aa6a700d8
28 changed files with 273 additions and 196 deletions

View File

@@ -116,7 +116,7 @@ App::DocumentObjectExecReturn *MultiCommon::execute(void)
std::vector<ShapeHistory> history;
TopoDS_Shape resShape = s.front();
if (resShape.IsNull())
throw Base::RuntimeError("Input shape is null");
throw NullShapeException("Input shape is null");
for (std::vector<TopoDS_Shape>::iterator it = s.begin()+1; it != s.end(); ++it) {
if (it->IsNull())
@@ -126,7 +126,7 @@ App::DocumentObjectExecReturn *MultiCommon::execute(void)
BRepAlgoAPI_Common mkCommon(resShape, *it);
// Let's check if the fusion has been successful
if (!mkCommon.IsDone())
throw Base::Exception("Intersection failed");
throw BooleanException("Intersection failed");
resShape = mkCommon.Shape();
ShapeHistory hist1 = buildHistory(mkCommon, TopAbs_FACE, resShape, mkCommon.Shape1());
@@ -142,7 +142,7 @@ App::DocumentObjectExecReturn *MultiCommon::execute(void)
}
}
if (resShape.IsNull())
throw Base::Exception("Resulting shape is invalid");
throw NullShapeException("Resulting shape is invalid");
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Part/Boolean");
@@ -196,7 +196,7 @@ App::DocumentObjectExecReturn *MultiCommon::execute(void)
}
}
else {
throw Base::Exception("Not enough shape objects linked");
throw Base::CADKernelError("Not enough shape objects linked");
}
return App::DocumentObject::StdReturn;