try/catch blocks added

This commit is contained in:
sln 2005-08-23 13:43:25 +00:00
parent bbfbac1990
commit ee06fcf090

View File

@ -25,6 +25,7 @@
#include <GEOM_SelectionFilter.h>
#include <SalomeApp_Tools.h>
#include <SALOMEDSClient_Study.hxx>
#include <SALOMEDSClient_AttributeIOR.hxx>
#include <SALOMEDSClient_AttributeName.hxx>
@ -109,18 +110,29 @@ bool SMESHGUI_MeshOp::onApply()
bool aResult = false;
aMess = "";
try
{
if ( myToCreate && myIsMesh )
aResult = createMesh( aMess );
if ( myToCreate && !myIsMesh )
aResult = createSubMesh( aMess );
else if ( !myToCreate )
aResult = editMeshOrSubMesh( aMess );
if ( aResult )
update( UF_ObjBrowser | UF_Model );
}
catch ( const SALOME::SALOME_Exception& S_ex )
{
SalomeApp_Tools::QtCatchCorbaException( S_ex );
aResult = false;
}
catch ( ... )
{
aResult = false;
}
if ( aResult )
{
update( UF_ObjBrowser | UF_Model );
// set default name if necessary
if ( myToCreate )
setDefaultName();
}
@ -228,6 +240,8 @@ void SMESHGUI_MeshOp::selectionDone()
SMESHGUI_SelectionOp::selectionDone();
if ( !myToCreate )
{
try
{
QString anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Obj );
_PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry );
@ -244,6 +258,14 @@ void SMESHGUI_MeshOp::selectionDone()
else
myDlg->reset();
}
catch ( const SALOME::SALOME_Exception& S_ex )
{
SalomeApp_Tools::QtCatchCorbaException( S_ex );
}
catch ( ... )
{
}
}
}
//================================================================================
@ -783,11 +805,13 @@ void SMESHGUI_MeshOp::readMesh()
{
// get algorithm
QStringList anExisting;
int aHypIndex = -1;
existingHyps( dim, Algo, pObj, anExisting, myObjHyps[ dim ][ Algo ] );
if ( myObjHyps[ dim ][ Algo ].count() > 0 )
{
SMESH::SMESH_Hypothesis_var aVar = myObjHyps[ dim ][ Algo ].first();
QString aHypTypeName = aVar->GetName();
int aHypIndex = -1;
QStringList aHypTypeNameList = SMESH::GetAvailableHypotheses( true , dim, false );
for ( int i = 0, n = aHypTypeNameList.count(); i < n; i++ )
if ( aHypTypeName == aHypTypeNameList[ i ] )
@ -795,6 +819,7 @@ void SMESHGUI_MeshOp::readMesh()
aHypIndex = i;
break;
}
}
setCurrentHyp( dim, Algo, aHypIndex );
// get hypotheses