diff --git a/src/Mod/TechDraw/App/DrawGeomHatch.cpp b/src/Mod/TechDraw/App/DrawGeomHatch.cpp index aebfb763d7..c116648b7b 100644 --- a/src/Mod/TechDraw/App/DrawGeomHatch.cpp +++ b/src/Mod/TechDraw/App/DrawGeomHatch.cpp @@ -268,7 +268,7 @@ std::vector DrawGeomHatch::getTrimmedLines(DrawViewPart* source, std::v TechDrawGeometry::BaseGeom* base = BaseGeom::baseFactory(e); if (base == nullptr) { Base::Console().Log("FAIL - DGH::getTrimmedLines - baseFactory failed for edge: %d\n",i); - throw Base::Exception("DGH::getTrimmedLines - baseFactory failed"); + throw Base::ValueError("DGH::getTrimmedLines - baseFactory failed"); } resultGeoms.push_back(base); i++; @@ -416,7 +416,7 @@ std::vector DrawGeomHatch::getFaceOverlay(int fdx) TechDrawGeometry::BaseGeom* base = BaseGeom::baseFactory(e); if (base == nullptr) { Base::Console().Log("FAIL - DGH::getFaceOverlay - baseFactory failed for edge: %d\n",i); - throw Base::Exception("DGH::getFaceOverlay - baseFactory failed"); + throw Base::ValueError("DGH::getFaceOverlay - baseFactory failed"); } resultGeoms.push_back(base); i++; diff --git a/src/Mod/TechDraw/App/DrawPage.cpp b/src/Mod/TechDraw/App/DrawPage.cpp index b326c51863..af7cb0df82 100644 --- a/src/Mod/TechDraw/App/DrawPage.cpp +++ b/src/Mod/TechDraw/App/DrawPage.cpp @@ -214,7 +214,7 @@ double DrawPage::getPageWidth() const return templ->getWidth(); } - throw Base::Exception("Template not set for Page"); + throw Base::RuntimeError("Template not set for Page"); } double DrawPage::getPageHeight() const @@ -229,7 +229,7 @@ double DrawPage::getPageHeight() const } } - throw Base::Exception("Template not set for Page"); + throw Base::RuntimeError("Template not set for Page"); } const char * DrawPage::getPageOrientation() const @@ -244,7 +244,7 @@ const char * DrawPage::getPageOrientation() const return templ->Orientation.getValueAsString(); } } - throw Base::Exception("Template not set for Page"); + throw Base::RuntimeError("Template not set for Page"); } int DrawPage::addView(App::DocumentObject *docObj) diff --git a/src/Mod/TechDraw/App/DrawParametricTemplate.cpp b/src/Mod/TechDraw/App/DrawParametricTemplate.cpp index 920507fffc..fde625e785 100644 --- a/src/Mod/TechDraw/App/DrawParametricTemplate.cpp +++ b/src/Mod/TechDraw/App/DrawParametricTemplate.cpp @@ -74,12 +74,12 @@ unsigned int DrawParametricTemplate::getMemSize(void) const } double DrawParametricTemplate::getWidth() const { - throw Base::Exception("Need to Implement"); + throw Base::NotImplementedError("Need to Implement"); } double DrawParametricTemplate::getHeight() const { - throw Base::Exception("Need to Implement"); + throw Base::NotImplementedError("Need to Implement"); } diff --git a/src/Mod/TechDraw/App/DrawProjGroup.cpp b/src/Mod/TechDraw/App/DrawProjGroup.cpp index fa135353b4..658357aeed 100644 --- a/src/Mod/TechDraw/App/DrawProjGroup.cpp +++ b/src/Mod/TechDraw/App/DrawProjGroup.cpp @@ -224,7 +224,7 @@ double DrawProjGroup::calculateAutomaticScale() const { TechDraw::DrawPage *page = getPage(); if (page == NULL) - throw Base::Exception("No page is assigned to this feature"); + throw Base::RuntimeError("No page is assigned to this feature"); DrawProjGroupItem *viewPtrs[10]; @@ -404,7 +404,7 @@ int DrawProjGroup::removeProjection(const char *viewProjType) // TODO: shouldn't be able to delete "Front" unless deleting whole group if ( checkViewProjType(viewProjType) ) { if( !hasProjection(viewProjType) ) { - throw Base::Exception("The projection doesn't exist in the group"); + throw Base::RuntimeError("The projection doesn't exist in the group"); } // Iterate through the child views and find the projection type @@ -676,10 +676,10 @@ int DrawProjGroup::getViewIndex(const char *viewTypeCStr) const } else if (strcmp(viewTypeCStr, "FrontBottomRight") == 0) { result = thirdAngle ? 9 : 0; } else { - throw Base::Exception("Unknown view type in DrawProjGroup::getViewIndex()"); + throw Base::TypeError("Unknown view type in DrawProjGroup::getViewIndex()"); } } else { - throw Base::Exception("Unknown Projection convention in DrawProjGroup::getViewIndex()"); + throw Base::ValueError("Unknown Projection convention in DrawProjGroup::getViewIndex()"); } return result; } @@ -736,12 +736,12 @@ void DrawProjGroup::arrangeViewPointers(DrawProjGroupItem *viewPtrs[10]) const } else if (strcmp(viewTypeCStr, "FrontBottomRight") == 0) { viewPtrs[thirdAngle ? 9 : 0] = oView; } else { - throw Base::Exception("Unknown view type in DrawProjGroup::arrangeViewPointers()"); + throw Base::TypeError("Unknown view type in DrawProjGroup::arrangeViewPointers()"); } } } } else { - throw Base::Exception("Unknown view type in DrawProjGroup::arrangeViewPointers()"); + throw Base::ValueError("Unknown view type in DrawProjGroup::arrangeViewPointers()"); } } diff --git a/src/Mod/TechDraw/App/DrawTemplate.cpp b/src/Mod/TechDraw/App/DrawTemplate.cpp index 89db103663..fdc53b0f26 100644 --- a/src/Mod/TechDraw/App/DrawTemplate.cpp +++ b/src/Mod/TechDraw/App/DrawTemplate.cpp @@ -128,7 +128,7 @@ App::DocumentObjectExecReturn *DrawTemplate::execute(void) void DrawTemplate::getBlockDimensions(double & /*x*/, double & /*y*/, double & /*width*/, double & /*height*/) const { - throw Base::Exception("implement in virtual function"); + throw Base::NotImplementedError("implement in virtual function"); } DrawPage* DrawTemplate::getParentPage() const diff --git a/src/Mod/TechDraw/App/DrawUtil.cpp b/src/Mod/TechDraw/App/DrawUtil.cpp index 1061ae50ba..8f6b6feffb 100644 --- a/src/Mod/TechDraw/App/DrawUtil.cpp +++ b/src/Mod/TechDraw/App/DrawUtil.cpp @@ -87,10 +87,10 @@ using namespace TechDraw; return int (std::strtol(what.str().c_str(), &endChar, 10)); //TODO: use std::stoi() in c++11 } else { ErrorMsg << "getIndexFromName: malformed geometry name - " << geomName; - throw Base::Exception(ErrorMsg.str()); + throw Base::ValueError(ErrorMsg.str()); } } else { - throw Base::Exception("getIndexFromName - empty geometry name"); + throw Base::ValueError("getIndexFromName - empty geometry name"); } } @@ -108,10 +108,10 @@ std::string DrawUtil::getGeomTypeFromName(std::string geomName) return what.str(); //TODO: use std::stoi() in c++11 } else { ErrorMsg << "In getGeomTypeFromName: malformed geometry name - " << geomName; - throw Base::Exception(ErrorMsg.str()); + throw Base::ValueError(ErrorMsg.str()); } } else { - throw Base::Exception("getGeomTypeFromName - empty geometry name"); + throw Base::ValueError("getGeomTypeFromName - empty geometry name"); } } diff --git a/src/Mod/TechDraw/App/DrawViewCollection.cpp b/src/Mod/TechDraw/App/DrawViewCollection.cpp index cdbaffd5ec..0d3ea9ff47 100644 --- a/src/Mod/TechDraw/App/DrawViewCollection.cpp +++ b/src/Mod/TechDraw/App/DrawViewCollection.cpp @@ -179,7 +179,7 @@ QRectF DrawViewCollection::getRect() const for (auto& v:Views.getValues()) { TechDraw::DrawView *view = dynamic_cast(v); if (!view) { - throw Base::Exception("DrawViewCollection::getRect bad View\n"); + throw Base::ValueError("DrawViewCollection::getRect bad View\n"); } result = result.united(view->getRect().translated(view->X.getValue(),view->Y.getValue())); diff --git a/src/Mod/TechDraw/App/DrawViewDimension.cpp b/src/Mod/TechDraw/App/DrawViewDimension.cpp index dd16b274ed..3d464cbc1d 100644 --- a/src/Mod/TechDraw/App/DrawViewDimension.cpp +++ b/src/Mod/TechDraw/App/DrawViewDimension.cpp @@ -561,7 +561,7 @@ double DrawViewDimension::getDimValue() } else if(Type.isValue("Angle")){ result = measurement->angle(); } else { //tarfu - throw Base::Exception("getDimValue() - Unknown Dimension Type (3)"); + throw Base::ValueError("getDimValue() - Unknown Dimension Type (3)"); } } else { // Projected Values @@ -793,7 +793,7 @@ pointPair DrawViewDimension::closestPoints(TopoDS_Shape s1, pointPair result; BRepExtrema_DistShapeShape extss(s1, s2); if (!extss.IsDone()) { - throw Base::Exception("DVD::closestPoints - BRepExtrema_DistShapeShape failed"); + throw Base::RuntimeError("DVD::closestPoints - BRepExtrema_DistShapeShape failed"); } int count = extss.NbSolution(); if (count != 0) { @@ -860,7 +860,7 @@ double DrawViewDimension::dist2Segs(Base::Vector2d s1, BRepExtrema_DistShapeShape extss(edge1, edge2); if (!extss.IsDone()) { - throw Base::Exception("DVD::dist2Segs - BRepExtrema_DistShapeShape failed"); + throw Base::RuntimeError("DVD::dist2Segs - BRepExtrema_DistShapeShape failed"); } int count = extss.NbSolution(); double minDist = 0.0; diff --git a/src/Mod/TechDraw/App/DrawViewSection.cpp b/src/Mod/TechDraw/App/DrawViewSection.cpp index d8f7a970fe..497c8dcb99 100644 --- a/src/Mod/TechDraw/App/DrawViewSection.cpp +++ b/src/Mod/TechDraw/App/DrawViewSection.cpp @@ -390,7 +390,7 @@ TopoDS_Face DrawViewSection::projectFace(const TopoDS_Shape &face, const Base::Vector3d &direction) { if(face.IsNull()) { - throw Base::Exception("DrawViewSection::projectFace - input Face is NULL"); + throw Base::ValueError("DrawViewSection::projectFace - input Face is NULL"); } Base::Vector3d origin(faceCenter.X(),faceCenter.Y(),faceCenter.Z()); diff --git a/src/Mod/TechDraw/App/EdgeWalker.cpp b/src/Mod/TechDraw/App/EdgeWalker.cpp index f1c2af0999..18a3d2aa93 100644 --- a/src/Mod/TechDraw/App/EdgeWalker.cpp +++ b/src/Mod/TechDraw/App/EdgeWalker.cpp @@ -132,7 +132,7 @@ bool EdgeWalker::loadEdges(std::vector edges) { //Base::Console().Message("TRACE -EW::loadEdges(TopoDS)\n"); if (edges.empty()) { - throw Base::Exception("EdgeWalker has no edges to load\n"); + throw Base::ValueError("EdgeWalker has no edges to load\n"); } std::vector verts = makeUniqueVList(edges); diff --git a/src/Mod/TechDraw/App/Geometry.cpp b/src/Mod/TechDraw/App/Geometry.cpp index 7d8021037a..123be79795 100644 --- a/src/Mod/TechDraw/App/Geometry.cpp +++ b/src/Mod/TechDraw/App/Geometry.cpp @@ -483,7 +483,7 @@ Base::Vector2d Generic::apparentInter(Generic* g) // Line Intersetion (taken from ViewProviderSketch.cpp) double det = dir0.x*dir1.y - dir0.y*dir1.x; if ((det > 0 ? det : -det) < 1e-10) - throw Base::Exception("Invalid selection - Det = 0"); + throw Base::ValueError("Invalid selection - Det = 0"); double c0 = dir0.y*points.at(0).x - dir0.x*points.at(0).y; double c1 = dir1.y*g->points.at(1).x - dir1.x*g->points.at(1).y; diff --git a/src/Mod/TechDraw/App/GeometryObject.cpp b/src/Mod/TechDraw/App/GeometryObject.cpp index acd29e6e43..e9ef3f451d 100644 --- a/src/Mod/TechDraw/App/GeometryObject.cpp +++ b/src/Mod/TechDraw/App/GeometryObject.cpp @@ -390,7 +390,7 @@ void GeometryObject::addGeomFromCompound(TopoDS_Shape edgeCompound, edgeClass ca base = BaseGeom::baseFactory(edge); if (base == nullptr) { Base::Console().Message("Error - GO::addGeomFromCompound - baseFactory failed for edge: %d\n",i); - throw Base::Exception("GeometryObject::addGeomFromCompound - baseFactory failed"); + throw Base::ValueError("GeometryObject::addGeomFromCompound - baseFactory failed"); } base->classOfEdge = category; base->visible = visible; diff --git a/src/Mod/TechDraw/Gui/Command.cpp b/src/Mod/TechDraw/Gui/Command.cpp index 56583ceac9..d5e44de011 100644 --- a/src/Mod/TechDraw/Gui/Command.cpp +++ b/src/Mod/TechDraw/Gui/Command.cpp @@ -137,7 +137,7 @@ void CmdTechDrawNewPageDef::activated(int iMsg) commitCommand(); TechDraw::DrawPage* fp = dynamic_cast(getDocument()->getObject(PageName.c_str())); if (!fp) { - throw Base::Exception("CmdTechDrawNewPageDef fp not found\n"); + throw Base::TypeError("CmdTechDrawNewPageDef fp not found\n"); } Gui::ViewProvider* vp = Gui::Application::Instance->getDocument(getDocument())->getViewProvider(fp); @@ -217,7 +217,7 @@ void CmdTechDrawNewPage::activated(int iMsg) commitCommand(); TechDraw::DrawPage* fp = dynamic_cast(getDocument()->getObject(PageName.c_str())); if (!fp) { - throw Base::Exception("CmdTechDrawNewPagePick fp not found\n"); + throw Base::TypeError("CmdTechDrawNewPagePick fp not found\n"); } Gui::ViewProvider* vp = Gui::Application::Instance->getDocument(getDocument())->getViewProvider(fp); TechDrawGui::ViewProviderPage* dvp = dynamic_cast(vp); @@ -309,7 +309,7 @@ void CmdTechDrawNewView::activated(int iMsg) App::DocumentObject *docObj = getDocument()->getObject(FeatName.c_str()); TechDraw::DrawViewPart* dvp = dynamic_cast(docObj); if (!dvp) { - throw Base::Exception("CmdTechDrawNewView DVP not found\n"); + throw Base::TypeError("CmdTechDrawNewView DVP not found\n"); } dvp->Source.setValues(shapes); doCommand(Doc,"App.activeDocument().%s.addView(App.activeDocument().%s)",PageName.c_str(),FeatName.c_str()); @@ -381,7 +381,7 @@ void CmdTechDrawNewViewSection::activated(int iMsg) App::DocumentObject *docObj = getDocument()->getObject(FeatName.c_str()); TechDraw::DrawViewSection* dsv = dynamic_cast(docObj); if (!dsv) { - throw Base::Exception("CmdTechDrawNewViewSection DVS not found\n"); + throw Base::TypeError("CmdTechDrawNewViewSection DVS not found\n"); } dsv->Source.setValues(dvp->Source.getValues()); doCommand(Doc,"App.activeDocument().%s.BaseView = App.activeDocument().%s",FeatName.c_str(),BaseName.c_str()); @@ -449,7 +449,7 @@ void CmdTechDrawNewViewDetail::activated(int iMsg) App::DocumentObject *docObj = getDocument()->getObject(FeatName.c_str()); TechDraw::DrawViewDetail* dvd = dynamic_cast(docObj); if (!dvd) { - throw Base::Exception("CmdTechDrawNewViewDetail DVD not found\n"); + throw Base::TypeError("CmdTechDrawNewViewDetail DVD not found\n"); } dvd->Source.setValues(dvp->Source.getValues()); diff --git a/src/Mod/TechDraw/Gui/CommandCreateDims.cpp b/src/Mod/TechDraw/Gui/CommandCreateDims.cpp index 3f9c5f9a69..9366476100 100644 --- a/src/Mod/TechDraw/Gui/CommandCreateDims.cpp +++ b/src/Mod/TechDraw/Gui/CommandCreateDims.cpp @@ -211,7 +211,7 @@ void CmdTechDrawNewDimension::activated(int iMsg) dim = dynamic_cast(getDocument()->getObject(FeatName.c_str())); if (!dim) { - throw Base::Exception("CmdTechDrawNewDimension - dim not found\n"); + throw Base::TypeError("CmdTechDrawNewDimension - dim not found\n"); } dim->References2D.setValues(objs, subs); @@ -310,7 +310,7 @@ void CmdTechDrawNewRadiusDimension::activated(int iMsg) dim = dynamic_cast(getDocument()->getObject(FeatName.c_str())); if (!dim) { - throw Base::Exception("CmdTechDrawNewRadiusDimension - dim not found\n"); + throw Base::TypeError("CmdTechDrawNewRadiusDimension - dim not found\n"); } dim->References2D.setValues(objs, subs); @@ -410,7 +410,7 @@ void CmdTechDrawNewDiameterDimension::activated(int iMsg) dim = dynamic_cast(getDocument()->getObject(FeatName.c_str())); if (!dim) { - throw Base::Exception("CmdTechDrawNewDiameterDimension - dim not found\n"); + throw Base::TypeError("CmdTechDrawNewDiameterDimension - dim not found\n"); } dim->References2D.setValues(objs, subs); @@ -519,7 +519,7 @@ void CmdTechDrawNewLengthDimension::activated(int iMsg) , "Distance"); dim = dynamic_cast(getDocument()->getObject(FeatName.c_str())); if (!dim) { - throw Base::Exception("CmdTechDrawNewLengthDimension - dim not found\n"); + throw Base::TypeError("CmdTechDrawNewLengthDimension - dim not found\n"); } dim->References2D.setValues(objs, subs); @@ -632,7 +632,7 @@ void CmdTechDrawNewDistanceXDimension::activated(int iMsg) dim = dynamic_cast(getDocument()->getObject(FeatName.c_str())); if (!dim) { - throw Base::Exception("CmdTechDrawNewDistanceXDimension - dim not found\n"); + throw Base::TypeError("CmdTechDrawNewDistanceXDimension - dim not found\n"); } dim->References2D.setValues(objs, subs); @@ -744,7 +744,7 @@ void CmdTechDrawNewDistanceYDimension::activated(int iMsg) ,"DistanceY"); dim = dynamic_cast(getDocument()->getObject(FeatName.c_str())); if (!dim) { - throw Base::Exception("CmdTechDrawNewDistanceYDimension - dim not found\n"); + throw Base::TypeError("CmdTechDrawNewDistanceYDimension - dim not found\n"); } dim->References2D.setValues(objs, subs); @@ -836,7 +836,7 @@ void CmdTechDrawNewAngleDimension::activated(int iMsg) dim = dynamic_cast(getDocument()->getObject(FeatName.c_str())); if (!dim) { - throw Base::Exception("CmdTechDrawNewAngleDimension - dim not found\n"); + throw Base::TypeError("CmdTechDrawNewAngleDimension - dim not found\n"); } dim->References2D.setValues(objs, subs); @@ -925,7 +925,7 @@ void CmdTechDrawNewAngle3PtDimension::activated(int iMsg) dim = dynamic_cast(getDocument()->getObject(FeatName.c_str())); if (!dim) { - throw Base::Exception("CmdTechDrawNewAngle3PtDimension - dim not found\n"); + throw Base::TypeError("CmdTechDrawNewAngle3PtDimension - dim not found\n"); } dim->References2D.setValues(objs, subs); diff --git a/src/Mod/TechDraw/Gui/QGIDrawingTemplate.cpp b/src/Mod/TechDraw/Gui/QGIDrawingTemplate.cpp index 8da70a1462..ed6d377e56 100644 --- a/src/Mod/TechDraw/Gui/QGIDrawingTemplate.cpp +++ b/src/Mod/TechDraw/Gui/QGIDrawingTemplate.cpp @@ -89,7 +89,7 @@ void QGIDrawingTemplate::draw() TechDraw::DrawParametricTemplate *tmplte = getParametricTemplate(); if(!tmplte) { - throw Base::Exception("Template Feuature not set for QGIDrawingTemplate"); + throw Base::RuntimeError("Template Feuature not set for QGIDrawingTemplate"); } diff --git a/src/Mod/TechDraw/Gui/QGISVGTemplate.cpp b/src/Mod/TechDraw/Gui/QGISVGTemplate.cpp index 5ae96f04c0..12ca62434d 100644 --- a/src/Mod/TechDraw/Gui/QGISVGTemplate.cpp +++ b/src/Mod/TechDraw/Gui/QGISVGTemplate.cpp @@ -128,7 +128,7 @@ void QGISVGTemplate::draw() { TechDraw::DrawSVGTemplate *tmplte = getSVGTemplate(); if(!tmplte) - throw Base::Exception("Template Feature not set for QGISVGTemplate"); + throw Base::RuntimeError("Template Feature not set for QGISVGTemplate"); load(QString::fromUtf8(tmplte->PageResult.getValue())); }