From: jfa Date: Mon, 9 Apr 2007 11:22:39 +0000 (+0000) Subject: NPAL15295: Information about Exception handling in Mefisto. Ensure adequate response... X-Git-Tag: V3_2_6pre4~40 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c2569cc79c498bd957d0c9823a666d452ff5ee03;p=modules%2Fsmesh.git NPAL15295: Information about Exception handling in Mefisto. Ensure adequate response from smesh.Mesh.Compute(). --- diff --git a/src/SMESH_SWIG/smesh.py b/src/SMESH_SWIG/smesh.py index 8eb305217..8d3943f11 100644 --- a/src/SMESH_SWIG/smesh.py +++ b/src/SMESH_SWIG/smesh.py @@ -34,6 +34,8 @@ from SMESH import * import StdMeshers +import SALOME + # import NETGENPlugin module if possible noNETGENPlugin = 0 try: @@ -1269,7 +1271,16 @@ class Mesh: return 0 else: geom = self.geom - ok = smesh.Compute(self.mesh, geom) + ok = False + try: + ok = smesh.Compute(self.mesh, geom) + except SALOME.SALOME_Exception, ex: + print "Mesh computation failed, exception cought:" + print " ", ex.details.text + except: + import traceback + print "Mesh computation failed, exception cought:" + traceback.print_exc() if not ok: errors = smesh.GetAlgoState( self.mesh, geom ) allReasons = "" @@ -1301,8 +1312,10 @@ class Mesh: allReasons += reason pass if allReasons != "": - print '"' + GetName(self.mesh) + '"',"not computed:" + print '"' + GetName(self.mesh) + '"',"has not been computed:" print allReasons + else: + print '"' + GetName(self.mesh) + '"',"has not been computed." pass pass if salome.sg.hasDesktop():