Sketcher: Fillet UI command Improved exception handling
This commit is contained in:
@@ -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()));
|
||||
|
||||
Reference in New Issue
Block a user