-// Copyright (C) 2007-2023 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2024 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
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;
}