App: improve exception handling in FeaturePython

This commit is contained in:
Zheng, Lei
2019-09-04 08:38:44 +08:00
committed by wmayer
parent 0f29155502
commit b450f5a5c8
2 changed files with 10 additions and 16 deletions

View File

@@ -3418,6 +3418,7 @@ int Document::_recomputeFeature(DocumentObject* Feat)
}
catch(Base::AbortException &e){
e.ReportException();
FC_ERR("Failed to recompute " << Feat->getFullName() << ": " << e.what());
d->addRecomputeLog("User abort",Feat);
return -1;
}
@@ -3428,6 +3429,7 @@ int Document::_recomputeFeature(DocumentObject* Feat)
}
catch (Base::Exception &e) {
e.ReportException();
FC_ERR("Failed to recompute " << Feat->getFullName() << ": " << e.what());
d->addRecomputeLog(e.what(),Feat);
return 1;
}
@@ -3449,11 +3451,7 @@ int Document::_recomputeFeature(DocumentObject* Feat)
}else{
returnCode->Which = Feat;
d->addRecomputeLog(returnCode);
#ifdef FC_DEBUG
FC_ERR("Failed to recompute " << Feat->getFullName() << ": " << returnCode->Why);
#else
FC_LOG("Failed to recompute " << Feat->getFullName() << ": " << returnCode->Why);
#endif
return 1;
}
return 0;