From f1e9966084e313ce1d6e4958c032bdac738833ea Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 10 Jan 2015 16:37:49 +0100 Subject: [PATCH] + fixes #0001054: Show name of feature when it reports a warning --- src/App/DocumentObjectPyImp.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/App/DocumentObjectPyImp.cpp b/src/App/DocumentObjectPyImp.cpp index 185c94a40..bbdf351e0 100644 --- a/src/App/DocumentObjectPyImp.cpp +++ b/src/App/DocumentObjectPyImp.cpp @@ -170,7 +170,14 @@ int DocumentObjectPy::setCustomAttributes(const char* attr, PyObject *obj) throw Py::AttributeError(s.str()); } - prop->setPyObject(obj); + try { + prop->setPyObject(obj); + } + catch (const Base::TypeError& e) { + std::stringstream s; + s << "Property '" << prop->getName() << "': " << e.what(); + throw Py::TypeError(s.str()); + } return 1; }