Salome HOME
[bos #40035][EDF] Handle Salome Exception in interface to retun meaninfull error... V9_12_BR cce/40035 V9_12_0 V9_12_0rc1 27/head
authorcconopoima <cesar.conopoima@gmail.com>
Wed, 6 Dec 2023 11:53:31 +0000 (11:53 +0000)
committercconopoima <cesar.conopoima@gmail.com>
Thu, 7 Dec 2023 09:30:46 +0000 (09:30 +0000)
idl/SMESH_BasicHypothesis.idl
src/StdMeshers/StdMeshers_Cartesian_VL.cxx
src/StdMeshers_I/StdMeshers_ViscousLayerBuilder_i.cxx

index 30281a309df91e47a258b11338d9ab37938cb4c1..3a097af9182afdbdd627713d8f7d6786a14c5d58 100644 (file)
@@ -1270,15 +1270,15 @@ module StdMeshers
     void SetTotalThickness(in double thickness) raises (SALOME::SALOME_Exception);
     void SetNumberLayers(in short numberOfLayers ) raises (SALOME::SALOME_Exception);
     void SetStretchFactor(in double strechFactor ) raises (SALOME::SALOME_Exception);
-    void SetMethod( in VLExtrusionMethod how );
-    void SetGroupName(in string name);
+    void SetMethod( in VLExtrusionMethod how ) raises (SALOME::SALOME_Exception);
+    void SetGroupName(in string name) raises (SALOME::SALOME_Exception);
 
-    GEOM::GEOM_Object GetShrinkGeometry( in SMESH::SMESH_Mesh finalMesh, in GEOM::GEOM_Object theObject );
+    GEOM::GEOM_Object GetShrinkGeometry( in SMESH::SMESH_Mesh finalMesh, in GEOM::GEOM_Object theObject ) raises (SALOME::SALOME_Exception);
 
     /*!
      * Build the prismatic layer from the shrink mesh
      */
-    boolean AddLayers( in SMESH::SMESH_Mesh sourceMesh, in SMESH::SMESH_Mesh finalMesh, in GEOM::GEOM_Object theObject );
+    boolean AddLayers( in SMESH::SMESH_Mesh sourceMesh, in SMESH::SMESH_Mesh finalMesh, in GEOM::GEOM_Object theObject ) raises (SALOME::SALOME_Exception);
 
   };
 
index 784996922ec273625cff20d3382b1f4c31ded6fb..ddf0f8965876dc042408e1c0f06e81fb0711c367 100644 (file)
@@ -1121,7 +1121,7 @@ bool StdMeshers_Cartesian_VL::ViscousBuilder::MakeViscousLayers( SMESH_Mesh &
 
   // Validate map of shrink+joint geometry elements
   if ( !CheckGeometryMaps(offsetMesh, theShape ) && !isMainShape2D )
-    throw SALOME_Exception("All elements from the shrink geometry were not match to the original geometry\n");
+    throw SALOME_Exception("The shrink geometry does not match or respect the original topology.The viscous layer can't be build");
 
   
   initMDS->ClearMesh(); // avoid mesh superposition on multiple calls of addLayers
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;
 }