Salome HOME
Merge branch 'hydro/imps_2015' into V7_dev
[modules/smesh.git] / src / DriverMED / DriverMED_R_SMESHDS_Mesh.cxx
index ba851616c2851908b1dc7c075d991668fad55a39..58f9c0ca024bcb095ba5b5b63407b84149060769 100644 (file)
@@ -172,7 +172,7 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
       //------------------------------------------------------
       PNodeInfo aNodeInfo = aMed->GetPNodeInfo(aMeshInfo);
       if (!aNodeInfo) {
-        aResult = DRS_FAIL;
+        aResult = addMessage("No nodes", /*isFatal=*/true );
         continue;
       }
       aMeshInfo->myDim=aMeshInfo->mySpaceDim;// ignore meshdim in MEDFile because it can be false
@@ -365,9 +365,9 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
                 }
 #ifndef _DEXCEPT_
               } catch(const std::exception& exc) {
-                aResult = DRS_FAIL;
+                aResult = addMessage( exc.what(), /*isFatal=*/true );
               } catch (...) {
-                aResult = DRS_FAIL;
+                aResult = addMessage( "Unknown exception", /*isFatal=*/true );
               }
 #endif
               if ( !anElement ) {
@@ -500,7 +500,8 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
             default:;
             }
             vector<TInt> aNodeIds(aNbNodes);
-            for(int iElem = 0; iElem < aNbElems; iElem++){
+            for ( int iElem = 0; iElem < aNbElems; iElem++ )
+            {
               bool anIsValidConnect = false;
               TCConnSlice aConnSlice = aCellInfo->GetConnSlice(iElem);
 #ifndef _DEXCEPT_
@@ -521,10 +522,10 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
 #ifndef _DEXCEPT_
               }catch(const std::exception& exc){
                 INFOS("Following exception was caught:\n\t"<<exc.what());
-                aResult = DRS_FAIL;
+                aResult = addMessage( exc.what(), /*isFatal=*/true );
               }catch(...){
                 INFOS("Unknown exception was caught !!!");
-                aResult = DRS_FAIL;
+                aResult = addMessage( "Unknown exception", /*isFatal=*/true );
               }
 #endif          
               if(!anIsValidConnect)
@@ -950,17 +951,19 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
                   }
                   break;
 
+                default:;
+
                 } // switch(aGeom)
 
 #ifndef _DEXCEPT_
-              }catch(const std::exception& exc){
+              } catch(const std::exception& exc) {
                 INFOS("The following exception was caught:\n\t"<<exc.what());
-                aResult = DRS_FAIL;
-              }catch(...){
+                aResult = addMessage( exc.what(), /*isFatal=*/true );
+              } catch(...) {
                 INFOS("Unknown exception was caught !!!");
-                aResult = DRS_FAIL;
+                aResult = addMessage( "Unknown exception", /*isFatal=*/true );
               }
-#endif          
+#endif
               if (!anElement) {
                 aResult = DRS_WARN_SKIP_ELEM;
               }
@@ -977,23 +980,25 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
                   myFamilies[aFamNum]->SetType(anElement->GetType());
                 }
               }
-            }
-          }}
-        }
-      }
+            } // loop on aNbElems
+          }} // switch(aGeom)
+        } // loop on aGeom2Size
+      } // loop on aEntityInfo
+
       if (aDescendingEntitiesMap.Extent()) isDescConn = true; // Mantis issue 0020483
+
     } // for(int iMesh = 0; iMesh < aNbMeshes; iMesh++)
 #ifndef _DEXCEPT_
   }
   catch(const std::exception& exc)
   {
     INFOS("The following exception was caught:\n\t"<<exc.what());
-    aResult = DRS_FAIL;
+    aResult = addMessage( exc.what(), /*isFatal=*/true );
   }
   catch(...)
   {
     INFOS("Unknown exception was caught !!!");
-    aResult = DRS_FAIL;
+    aResult = addMessage( "Unknown exception", /*isFatal=*/true );
   }
 #endif
   if (myMesh)