From: Renaud Barate Date: Thu, 12 Aug 2010 14:09:21 +0000 (+0000) Subject: Raise exception when the case entry is obviously not a case for code DEVIATION X-Git-Tag: V5_1_5~7 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=bcfc27af35898d796f5d4939e5cfddf5d1c87e04;p=samples%2Fgenericsolver.git Raise exception when the case entry is obviously not a case for code DEVIATION --- diff --git a/src/GENERICSOLVER/DEVIATION.py b/src/GENERICSOLVER/DEVIATION.py index daed18d..7df999a 100644 --- a/src/GENERICSOLVER/DEVIATION.py +++ b/src/GENERICSOLVER/DEVIATION.py @@ -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