From ab06a7ed6106667bbfe8e3fcf679e68bf1e0214f Mon Sep 17 00:00:00 2001 From: Daniel Brown <ddb@star.sr.bham.ac.uk> Date: Sun, 2 Mar 2014 18:07:26 +0000 Subject: [PATCH] better error handling --- pykat/commands.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pykat/commands.py b/pykat/commands.py index 4c486f8..ebe0db0 100644 --- a/pykat/commands.py +++ b/pykat/commands.py @@ -66,13 +66,15 @@ class gauss(object): elif len(values) == 8: gpx = gauss_param(z=values[-4], zr=values[-3]) gpy = gauss_param(z=values[-2], zr=values[-1]) - else: + elif values[0].endswith("**"): if len(values) == 6: gp = gauss_param(w=values[-2], rc=values[-1]) elif len(values) == 8: gpx = gauss_param(w=values[-4], rc=values[-3]) gpy = gauss_param(w=values[-2], rc=values[-1]) - + else: + raise pkex.BasePyKatException("Unexpected ending to gauss command '{0}'".format(text)) + if len(values) == 6: kat.nodes[node].setGauss(kat.components[component], gp) else: -- GitLab