[svn-genapp] r1712 - tutorial2/bin

svn@...
 

Author: ehb
Date: Sun Sep 22 11:48:25 2019
New Revision: 1712

Log:
Further try/catch updates

Modified:
tutorial2/bin/repeater.py

Modified: tutorial2/bin/repeater.py
==============================================================================
--- tutorial2/bin/repeater.py Sun Sep 22 11:45:27 2019 (r1711)
+++ tutorial2/bin/repeater.py Sun Sep 22 11:48:25 2019 (r1712)
@@ -13,12 +13,14 @@
'c' in json_variables :
try:
mass = float(json_variables['m'])
- except ValueError:
+ except TypeError:
output['notice'] = "Expected JSON input variables 'm' and/or 'c' not found or incorrect type"
+ mass = 0
try:
speed_of_light = float(json_variables['c'])
- except ValueError:
+ except TypeError:
output['notice'] = "Expected JSON input variables 'm' and/or 'c' not found or incorrect type"
+ speed_of_light = 0

import mass_energy

Join genapp-commits@groups.io to automatically receive all group messages.