From b65faeff771b629d2598a3af8a26845de28e55d9 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 10 Nov 2018 01:13:42 +0100 Subject: [PATCH] fixes 0003627: Hole fails to restore from file --- src/App/Document.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/App/Document.cpp b/src/App/Document.cpp index 5e71cbdb63e7..9278e0e07750 100644 --- a/src/App/Document.cpp +++ b/src/App/Document.cpp @@ -1546,7 +1546,23 @@ Document::readObjects(Base::XMLReader& reader) DocumentObject* pObj = getObject(name.c_str()); if (pObj) { // check if this feature has been registered pObj->setStatus(ObjectStatus::Restore, true); - pObj->Restore(reader); + try { + pObj->Restore(reader); + } + // Try to continue only for certain exception types if not handled + // by the feature type. For all other exception types abort the process. + catch (const Base::UnicodeError &e) { + e.ReportException(); + } + catch (const Base::ValueError &e) { + e.ReportException(); + } + catch (const Base::IndexError &e) { + e.ReportException(); + } + catch (const Base::RuntimeError &e) { + e.ReportException(); + } pObj->setStatus(ObjectStatus::Restore, false); } reader.readEndElement("Object");