From bcfc27af35898d796f5d4939e5cfddf5d1c87e04 Mon Sep 17 00:00:00 2001 From: Renaud Barate Date: Thu, 12 Aug 2010 14:09:21 +0000 Subject: [PATCH] Raise exception when the case entry is obviously not a case for code DEVIATION --- src/GENERICSOLVER/DEVIATION.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 -- 2.39.2