Salome HOME
[bos #40035][EDF] Handle Salome Exception in interface to retun meaninfull error...
[modules/smesh.git] / src / StdMeshers_I / StdMeshers_ViscousLayerBuilder_i.cxx
index 3fc156116c4004dccf51e813825c3d6d58b66646..a34390f6cbcea19b8d61c920814b7c9ba1fbbaaa 100644 (file)
@@ -188,8 +188,16 @@ CORBA::Boolean StdMeshers_ViscousLayerBuilder_i::AddLayers( SMESH::SMESH_Mesh_pt
   TopoDS_Shape theShape         = StdMeshers_ObjRefUlils::GeomObjectToShape( theShapeObject );
   SMESH_Mesh_i* shrinkMesh_i    = SMESH::DownCast< SMESH_Mesh_i* >( shrinkMesh );
   SMESH_Mesh_i* theFinalMesh_i  = SMESH::DownCast< SMESH_Mesh_i* >( finalMesh );
-  
-  bool success = GetImpl()->AddLayers( shrinkMesh_i->GetImpl(), theFinalMesh_i->GetImpl(), theShape );  
+  bool success = false;
+
+  try 
+  {
+    success = GetImpl()->AddLayers( shrinkMesh_i->GetImpl(), theFinalMesh_i->GetImpl(), theShape );  
+  }
+  catch ( std::exception& exc )
+  {
+    THROW_SALOME_CORBA_EXCEPTION( exc.what(), SALOME::INTERNAL_ERROR  );
+  }
   
   return success;
 }