NPAL15295: Information about Exception handling in Mefisto. Ensure adequate response from smesh.Mesh.Compute().

This commit is contained in:
jfa 2007-04-09 11:22:39 +00:00
parent 0fcbb05a58
commit c2569cc79c

View File

@ -34,6 +34,8 @@ from SMESH import *
import StdMeshers import StdMeshers
import SALOME
# import NETGENPlugin module if possible # import NETGENPlugin module if possible
noNETGENPlugin = 0 noNETGENPlugin = 0
try: try:
@ -1269,7 +1271,16 @@ class Mesh:
return 0 return 0
else: else:
geom = self.geom 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: if not ok:
errors = smesh.GetAlgoState( self.mesh, geom ) errors = smesh.GetAlgoState( self.mesh, geom )
allReasons = "" allReasons = ""
@ -1301,8 +1312,10 @@ class Mesh:
allReasons += reason allReasons += reason
pass pass
if allReasons != "": if allReasons != "":
print '"' + GetName(self.mesh) + '"',"not computed:" print '"' + GetName(self.mesh) + '"',"has not been computed:"
print allReasons print allReasons
else:
print '"' + GetName(self.mesh) + '"',"has not been computed."
pass pass
pass pass
if salome.sg.hasDesktop(): if salome.sg.hasDesktop():