Salome HOME
NPAL18017: EDF GEOM V3.2.9rc1 : Exception raised when getShapeOn... function return...
authorjfa <jfa@opencascade.com>
Thu, 29 Nov 2007 13:19:23 +0000 (13:19 +0000)
committerjfa <jfa@opencascade.com>
Thu, 29 Nov 2007 13:19:23 +0000 (13:19 +0000)
src/GEOM/GEOM_IOperations.hxx
src/GEOMImpl/GEOMImpl_IShapesOperations.cxx
src/GEOM_SWIG/geompy.py

index 2544b1e1a2aab8a54efdc1b335937421fa5c885b..67781992d1609c1e08380024a64ce0f5f62b09c7 100644 (file)
@@ -29,6 +29,7 @@
 
 #define OK "PAL_NO_ERROR"
 #define KO "PAL_NOT_DONE_ERROR"
+#define NOT_FOUND_ANY "NOT_FOUND_ANY"
 #define ALREADY_PRESENT "PAL_ELEMENT_ALREADY_PRESENT"
 #define NOT_EXISTS "PAL_ELEMENT_DOES_NOT_EXISTS"
 #define INVALID_TYPE "INVALID_TYPE_OF_ELEMENT"
index 0eb5716c5dcd21024365f0250f43df423c3d5106..a9c54b647db00897888851ab89665e55c8f00da5 100644 (file)
@@ -780,7 +780,8 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::MakeExplode
   }
 
   if (listShape.IsEmpty()) {
-    SetErrorCode("The given shape has no sub-shapes of the requested type");
+    //SetErrorCode("The given shape has no sub-shapes of the requested type");
+    SetErrorCode(NOT_FOUND_ANY); // NPAL18017
     return aSeq;
   }
 
@@ -825,7 +826,7 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::MakeExplode
 
 //=============================================================================
 /*!
- *  GetSubShapeAllIDs
+ *  SubShapeAllIDs
  */
 //=============================================================================
 Handle(TColStd_HSequenceOfInteger) GEOMImpl_IShapesOperations::SubShapeAllIDs
@@ -864,7 +865,8 @@ Handle(TColStd_HSequenceOfInteger) GEOMImpl_IShapesOperations::SubShapeAllIDs
   }
 
   if (listShape.IsEmpty()) {
-    SetErrorCode("The given shape has no sub-shapes of the requested type");
+    //SetErrorCode("The given shape has no sub-shapes of the requested type");
+    SetErrorCode(NOT_FOUND_ANY); // NPAL18017
     return aSeq;
   }
 
@@ -1480,7 +1482,8 @@ Handle(TColStd_HSequenceOfInteger)
   const TopTools_ListOfShape& listSS = aFinder.Shapes(); // the result
 
   if (listSS.Extent() < 1) {
-    SetErrorCode("Not a single sub-shape of the requested type found on the given surface");
+    //SetErrorCode("Not a single sub-shape of the requested type found on the given surface");
+    SetErrorCode(NOT_FOUND_ANY); // NPAL18017
     return aSeqOfIDs;
   }
 
@@ -1654,7 +1657,8 @@ Handle(TColStd_HSequenceOfInteger)
   const TopTools_ListOfShape& listSS = aFinder.Shapes(); // the result
 
   if (listSS.Extent() < 1) {
-    SetErrorCode("Not a single sub-shape of the requested type found on the given surface");
+    //SetErrorCode("Not a single sub-shape of the requested type found on the given surface");
+    SetErrorCode(NOT_FOUND_ANY); // NPAL18017
     return aSeqOfIDs;
   }
 
@@ -2281,7 +2285,8 @@ Handle(TColStd_HSequenceOfInteger)
   const TopTools_ListOfShape& listSS = aFinder.Shapes(); // the result
 
   if (listSS.Extent() < 1) {
-    SetErrorCode("Not a single sub-shape of the requested type found on the given surface");
+    //SetErrorCode("Not a single sub-shape of the requested type found on the given surface");
+    SetErrorCode(NOT_FOUND_ANY); // NPAL18017
     return aSeqOfIDs;
   }
 
index aa985f00aa51b2a1726175e0724f8ba2d59db19c..2120bb0a6e1a867376b046ab5dafd7f01798a58a 100644 (file)
@@ -141,7 +141,8 @@ def addToStudyInFather(aFather, aShape, aName):
 # Raise an Error if Operation is Failed
 # -----------------------------------------------------------------------------
 def RaiseIfFailed (method_name, operation):
-    if operation.IsDone() == 0:
+    #NPAL18017#if operation.IsDone() == 0:
+    if operation.IsDone() == 0 and operation.GetErrorCode() != "NOT_FOUND_ANY":
       raise RuntimeError, method_name + " : " + operation.GetErrorCode()
 
 # -----------------------------------------------------------------------------