Sketcher: Fillet UI command Improved exception handling

This commit is contained in:
Abdullah Tahiri
2018-10-28 16:15:45 +01:00
committed by wmayer
parent 6c7684b2c7
commit 7abc5fec65

View File

@@ -27,6 +27,8 @@
# include <QApplication>
#endif
# include <QMessageBox>
#include <stdlib.h>
#include <qdebug.h>
#include <QString>
@@ -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<Sketcher::SketchObject *>(sketchgui->getObject()));