]> SALOME platform Git repositories - samples/genericsolver.git/commitdiff
Salome HOME
Raise exception when the case entry is obviously not a case for code DEVIATION
authorRenaud Barate <renaud.barate@edf.fr>
Thu, 12 Aug 2010 14:09:21 +0000 (14:09 +0000)
committerRenaud Barate <renaud.barate@edf.fr>
Thu, 12 Aug 2010 14:09:21 +0000 (14:09 +0000)
src/GENERICSOLVER/DEVIATION.py

index daed18dfcdbb2fa0d610940592e9f2b3ff7dbb4c..7df999a39c1362f97b8681aed4a19defefdd4090 100644 (file)
@@ -48,9 +48,10 @@ def GetDataFromCase( studyId, caseEntry ):
     # Get the values of the variables and make them a list
     for name in ("E", "F", "L", "I"):
         var = getSubSObjectByName( studyId, case, name )
-        if var == None:
-            logger.error("GENERICSOLVER.GetDataFromCase : ERROR! no variable '%s'" % name)
-            break
+        if var is None:
+            raise Exception('No variable "%s" was found in case "%s" (entry %s). '
+                            'It is probably not a case for the code DEVIATION.' %
+                            (name, case.GetName(), caseEntry))
         theCase[ name ] = getValueOfVariable( builder, var )
     return theCase