From aefe6e17901319f669ee23e357d61ad66c0705cd Mon Sep 17 00:00:00 2001 From: wmayer Date: Fri, 31 Jul 2020 13:59:40 +0200 Subject: [PATCH] App: [skip ci] for a recompute do not report every exception as error There are a lof of scenarios where it's not possible to perform an operation without throwing an exception. Reporting an exception as error is not only annoying but often confusing because the user assumes he did something wrong. So, for the moment many of these exceptions are reported as log messages but serious things like memory exception, std. C++ exceptions or unknown C++ exceptions are still reported as errors --- src/App/Document.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/App/Document.cpp b/src/App/Document.cpp index 7ea4fccec6..4d1fa65c96 100644 --- a/src/App/Document.cpp +++ b/src/App/Document.cpp @@ -3536,8 +3536,8 @@ int Document::recompute(const std::vector &objs, bool forc FC_TIME_LOG(t,"Recompute total"); - if(d->_RecomputeLog.size()) - Base::Console().Error("Recompute failed! Please check report view.\n"); + if (d->_RecomputeLog.size()) + Base::Console().Log("Recompute failed! Please check report view.\n"); return objectCount; } @@ -3732,7 +3732,7 @@ int Document::_recomputeFeature(DocumentObject* Feat) } catch(Base::AbortException &e){ e.ReportException(); - FC_ERR("Failed to recompute " << Feat->getFullName() << ": " << e.what()); + FC_LOG("Failed to recompute " << Feat->getFullName() << ": " << e.what()); d->addRecomputeLog("User abort",Feat); return -1; } @@ -3743,7 +3743,7 @@ int Document::_recomputeFeature(DocumentObject* Feat) } catch (Base::Exception &e) { e.ReportException(); - FC_ERR("Failed to recompute " << Feat->getFullName() << ": " << e.what()); + FC_LOG("Failed to recompute " << Feat->getFullName() << ": " << e.what()); d->addRecomputeLog(e.what(),Feat); return 1; } @@ -3760,12 +3760,13 @@ int Document::_recomputeFeature(DocumentObject* Feat) } #endif - if(returnCode == DocumentObject::StdReturn) { + if (returnCode == DocumentObject::StdReturn) { Feat->resetError(); - }else{ + } + else { returnCode->Which = Feat; d->addRecomputeLog(returnCode); - FC_ERR("Failed to recompute " << Feat->getFullName() << ": " << returnCode->Why); + FC_LOG("Failed to recompute " << Feat->getFullName() << ": " << returnCode->Why); return 1; } return 0;