Port to occ7.2:

+ Standard_Failure::Caught() is now marked as deprecated and should be replaced with standard C++ exception handling
This commit is contained in:
wmayer
2017-09-01 14:16:24 +02:00
parent 84754aef7e
commit 0d617f97d6
96 changed files with 1497 additions and 1714 deletions

View File

@@ -365,9 +365,8 @@ private:
aReader.Transfer(hDoc);
pi->EndScope();
}
catch (OSD_Exception) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
Base::Console().Error("%s\n", e->GetMessageString());
catch (OSD_Exception& e) {
Base::Console().Error("%s\n", e.GetMessageString());
Base::Console().Message("Try to load STEP file without colors...\n");
Part::ImportStepParts(pcDoc,Utf8Name.c_str());
@@ -401,9 +400,8 @@ private:
Handle(IGESToBRep_Actor)::DownCast(aReader.WS()->TransferReader()->Actor())
->SetModel(new IGESData_IGESModel);
}
catch (OSD_Exception) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
Base::Console().Error("%s\n", e->GetMessageString());
catch (OSD_Exception& e) {
Base::Console().Error("%s\n", e.GetMessageString());
Base::Console().Message("Try to load IGES file without colors...\n");
Part::ImportIgesParts(pcDoc,Utf8Name.c_str());
@@ -427,9 +425,8 @@ private:
pcDoc->recompute();
hApp->Close(hDoc);
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
throw Py::Exception(Base::BaseExceptionFreeCADError, e->GetMessageString());
catch (Standard_Failure& e) {
throw Py::Exception(Base::BaseExceptionFreeCADError, e.GetMessageString());
}
catch (const Base::Exception& e) {
throw Py::RuntimeError(e.what());
@@ -603,9 +600,8 @@ private:
hApp->Close(hDoc);
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
throw Py::Exception(Base::BaseExceptionFreeCADError, e->GetMessageString());
catch (Standard_Failure& e) {
throw Py::Exception(Base::BaseExceptionFreeCADError, e.GetMessageString());
}
catch (const Base::Exception& e) {
throw Py::RuntimeError(e.what());
@@ -697,9 +693,8 @@ private:
browse.load(dlg->findChild<QTreeWidget*>());
hApp->Close(hDoc);
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
throw Py::Exception(Base::BaseExceptionFreeCADError, e->GetMessageString());
catch (Standard_Failure& e) {
throw Py::Exception(Base::BaseExceptionFreeCADError, e.GetMessageString());
}
catch (const Base::Exception& e) {
throw Py::RuntimeError(e.what());