From 3f4795d9cafe23370ea20c4f4ffec4aee066a62c Mon Sep 17 00:00:00 2001 From: Ferry Boender Date: Fri, 3 Apr 2015 17:37:17 +0200 Subject: [PATCH] Proper error raising when a form does not exist. --- src/scriptform.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/scriptform.py b/src/scriptform.py index 6376245..6be3464 100755 --- a/src/scriptform.py +++ b/src/scriptform.py @@ -212,6 +212,8 @@ class FormConfig: for form_def in self.forms: if form_def.name == form_name: return form_def + else: + raise ValueError("No such form: {0}".format(form_name)) def callback(self, form_name, form_values, output_fh=None): form = self.get_form(form_name)