Base: fix duplicated exception message

Because the exception can propagate across C++ and Python boundary
multiple times, prepending extra information may cause duplication,
something like,

"FreeCAD exception thrown(FreeCAD exception thrown(..."
This commit is contained in:
Zheng, Lei
2019-08-02 12:43:03 +08:00
committed by wmayer
parent d3500ecfab
commit 9e3a981d37

View File

@@ -466,24 +466,13 @@ BaseExport extern PyObject* BaseExceptionFreeCADAbort;
{ \
e.ReportException(); \
auto pye = e.getPyExceptionType(); \
if(!pye) { \
if(!pye) \
pye = Base::BaseExceptionFreeCADError; \
std::string str; \
str += "FreeCAD exception thrown ("; \
str += e.what(); \
str += ")"; \
e.setMessage(str); \
} \
_Py_ErrorObj(R,pye,e.getPyObject()); \
} \
catch(std::exception &e) \
{ \
std::string str; \
str += "STL exception thrown ("; \
str += e.what(); \
str += ")"; \
Base::Console().Error(str.c_str()); \
_Py_Error(R,Base::BaseExceptionFreeCADError,str.c_str()); \
_Py_Error(R,Base::BaseExceptionFreeCADError,e.what()); \
} \
catch(const Py::Exception&) \
{ \