From 11fd515ab038baab40fe32b0ec900bbb4755dd55 Mon Sep 17 00:00:00 2001 From: richard Date: Thu, 12 Sep 2002 06:02:45 +0000 Subject: [PATCH] nicer errors git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1150 57a73879-2fb5-44c3-a270-3262357dd7e2 --- roundup/cgi/client.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/roundup/cgi/client.py b/roundup/cgi/client.py index 9bbe94e..6a81a69 100644 --- a/roundup/cgi/client.py +++ b/roundup/cgi/client.py @@ -1,4 +1,4 @@ -# $Id: client.py,v 1.28 2002-09-11 23:54:25 richard Exp $ +# $Id: client.py,v 1.29 2002-09-12 06:02:45 richard Exp $ __doc__ = """ WWW request handler (also used in the stand-alone server). @@ -1141,6 +1141,10 @@ def parsePropsFromForm(db, cl, form, nodeid=0, num_re=re.compile('^\d+$')): raise ValueError, _('property "%(propname)s": ' '%(value)s not a %(classname)s')%{'propname':key, 'value': value, 'classname': link} + except TypeError, message: + raise ValueError, _('you may only enter ID values ' + 'for property "%(propname)s": %(message)s'%{ + 'propname':key, 'message': message} elif isinstance(proptype, hyperdb.Multilink): if isinstance(value, type([])): # it's a list of MiniFieldStorages @@ -1160,6 +1164,10 @@ def parsePropsFromForm(db, cl, form, nodeid=0, num_re=re.compile('^\d+$')): raise ValueError, _('property "%(propname)s": ' '"%(value)s" not an entry of %(classname)s')%{ 'propname':key, 'value': entry, 'classname': link} + except TypeError, message: + raise ValueError, _('you may only enter ID values ' + 'for property "%(propname)s": %(message)s'%{ + 'propname':key, 'message': message} l.append(entry) l.sort() value = l -- 2.30.2