FEM: view provider electrostatic potential, use value error instead of bare except

This commit is contained in:
Bernd Hahnebach
2019-07-02 22:54:58 +02:00
parent 95f3325986
commit 2d7d6cfef6

View File

@@ -129,10 +129,11 @@ class _TaskPanel(object):
quantity = None
try:
quantity = Units.Quantity(self._paramWidget.potentialTxt.text())
except:
except ValueError:
FreeCAD.Console.PrintMessage(
'Potential not set. OK has been triggered wihtout a green hook '
'in the input field. Not recognised input: {}\n'
'Wrong input. OK has been triggered without a green hook '
'in the input field. Not recognised input: "{}" '
'Potential has not been set.\n'
.format(self._paramWidget.potentialTxt.text())
)
if quantity is not None: