fixes not handled exception in "task_mesh_gmsh.py"
error = sys.exc_info()[0].strip() <class 'AttributeError'>: type object 'RuntimeError' has no attribute 'strip' Furthermore reporting "value" instead of "type" gives more useful error messages
This commit is contained in:
@@ -203,11 +203,11 @@ class _TaskPanel:
|
||||
error = gmsh_mesh.create_mesh()
|
||||
except Exception:
|
||||
import sys
|
||||
error = sys.exc_info()[1]
|
||||
FreeCAD.Console.PrintMessage(
|
||||
"Unexpected error when creating mesh: {}\n"
|
||||
.format(sys.exc_info()[0])
|
||||
.format(error)
|
||||
)
|
||||
error = sys.exc_info()[0].strip()
|
||||
if error:
|
||||
FreeCAD.Console.PrintMessage("Gmsh had warnings ...\n")
|
||||
FreeCAD.Console.PrintMessage("{}\n".format(error))
|
||||
|
||||
@@ -380,7 +380,7 @@ class FemToolsCcx(QtCore.QRunnable, QtCore.QObject):
|
||||
except Exception:
|
||||
FreeCAD.Console.PrintError(
|
||||
"Unexpected error when writing CalculiX input file: {}\n"
|
||||
.format(sys.exc_info()[0])
|
||||
.format(sys.exc_info()[1])
|
||||
)
|
||||
raise
|
||||
|
||||
|
||||
Reference in New Issue
Block a user