|
From: <sub...@co...> - 2006-10-18 22:55:19
|
Author: ianb
Date: 2006-10-18 16:54:35 -0600 (Wed, 18 Oct 2006)
New Revision: 2026
Modified:
FormEncode/trunk/formencode/htmlfill.py
Log:
Fix the way the last commit raises the error
Modified: FormEncode/trunk/formencode/htmlfill.py
===================================================================
--- FormEncode/trunk/formencode/htmlfill.py 2006-10-18 22:08:13 UTC (rev 2025)
+++ FormEncode/trunk/formencode/htmlfill.py 2006-10-18 22:54:35 UTC (rev 2026)
@@ -236,17 +236,17 @@
t for t in self._content if not isinstance(t, tuple)])
except UnicodeDecodeError, e:
if self.data_is_str:
- raise UnicodeDecodeError(
+ e.reason += (
"The form was passed in as an encoded string, but "
"some data or error messages were unicode strings; "
- "the form should be passed in as a unicode string "
- "(error: %s)" % e)
+ "the form should be passed in as a unicode string")
else:
- raise UnicodeDecodeError(
+ e.reason += (
"The form was passed in as an unicode string, but "
"some data or error message was an encoded string; "
"the data and error messages should be passed in as "
- "unicode strings (error: %s)" % e)
+ "unicode strings")
+ raise
def add_key(self, key):
self.used_keys[key] = 1
|