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
This commit is contained in:
wmayer
2020-07-31 13:59:40 +02:00
parent 87e7a3762b
commit a7738cec07

View File

@@ -3536,8 +3536,8 @@ int Document::recompute(const std::vector<App::DocumentObject*> &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;