From 7abc5fec659dde8ab33ab4ac110751f08455accb Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Sun, 28 Oct 2018 16:15:45 +0100 Subject: [PATCH] Sketcher: Fillet UI command Improved exception handling --- src/Mod/Sketcher/Gui/CommandCreateGeo.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp b/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp index acf65adabc..c2e57671fa 100644 --- a/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp +++ b/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp @@ -27,6 +27,8 @@ # include #endif +# include + #include #include #include @@ -5848,9 +5850,21 @@ public: secondPos.x, secondPos.y, radius); Gui::Command::commitCommand(); } - catch (const Base::Exception& e) { - Base::Console().Error("Failed to create fillet: %s\n", e.what()); + catch (const Base::CADKernelError& e) { + e.ReportException(); + if(e.getTranslatable()) { + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("CAD Kernel Error"), + QObject::tr(e.getMessage().c_str())); + } + Gui::Selection().clearSelection(); Gui::Command::abortCommand(); + Mode = STATUS_SEEK_First; + } + catch (const Base::ValueError& e) { + e.ReportException(); + Gui::Selection().clearSelection(); + Gui::Command::abortCommand(); + Mode = STATUS_SEEK_First; } tryAutoRecompute(static_cast(sketchgui->getObject()));