From 02c51ff2dd75dbaa6802f2d34f7cd22c8507cbbd Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 5 Dec 2018 11:31:16 +0100 Subject: [PATCH] if activating a workbench raises a general error then add the name to the message --- src/Gui/ApplicationPy.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Gui/ApplicationPy.cpp b/src/Gui/ApplicationPy.cpp index 4ad3d77845..ab344d0436 100644 --- a/src/Gui/ApplicationPy.cpp +++ b/src/Gui/ApplicationPy.cpp @@ -776,7 +776,9 @@ PyObject* Application::sActivateWorkbenchHandler(PyObject * /*self*/, PyObject * Instance->activateWorkbench(psKey); } catch (const Base::Exception& e) { - PyErr_SetString(Base::BaseExceptionFreeCADError, e.what()); + std::stringstream err; + err << psKey << ": " << e.what(); + PyErr_SetString(Base::BaseExceptionFreeCADError, err.str().c_str()); return 0; } catch (const XERCES_CPP_NAMESPACE_QUALIFIER TranscodingException& e) { @@ -792,7 +794,9 @@ PyObject* Application::sActivateWorkbenchHandler(PyObject * /*self*/, PyObject * return 0; } catch (...) { - PyErr_SetString(Base::BaseExceptionFreeCADError, "Unknown C++ exception raised in activateWorkbench"); + std::stringstream err; + err << "Unknown C++ exception raised in activateWorkbench('" << psKey << "')"; + PyErr_SetString(Base::BaseExceptionFreeCADError, err.str().c_str()); return 0; }