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 5aa60a4d3b
commit 949c86d364
96 changed files with 1497 additions and 1714 deletions

View File

@@ -135,9 +135,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());
@@ -171,9 +170,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());
@@ -194,9 +192,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());
@@ -307,9 +304,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());
@@ -369,9 +365,8 @@ static PyObject * importAssembly(PyObject *self, PyObject *args)
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,Name);
@@ -398,9 +393,8 @@ static PyObject * importAssembly(PyObject *self, PyObject *args)
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 IGES file without colors...\n");
Part::ImportIgesParts(pcDoc,Name);
@@ -417,9 +411,8 @@ static PyObject * importAssembly(PyObject *self, PyObject *args)
pcDoc->recompute();
}
catch (Standard_Failure) {
Handle(Standard_Failure) e = Standard_Failure::Caught();
PyErr_SetString(PyExc_RuntimeError, e->GetMessageString());
catch (Standard_Failure& e) {
PyErr_SetString(PyExc_RuntimeError, e.GetMessageString());
return 0;
}
PY_CATCH