[Checkins] SVN: z3c.schema2xml/branches/combined-deserialization-errors/src/z3c/schema2xml/_schema2xml.py Also report the element which caused the error.

Christian Theune ct at gocept.com
Thu Oct 1 09:22:02 EDT 2009


Log message for revision 104680:
  Also report the element which caused the error.
  

Changed:
  U   z3c.schema2xml/branches/combined-deserialization-errors/src/z3c/schema2xml/_schema2xml.py

-=-
Modified: z3c.schema2xml/branches/combined-deserialization-errors/src/z3c/schema2xml/_schema2xml.py
===================================================================
--- z3c.schema2xml/branches/combined-deserialization-errors/src/z3c/schema2xml/_schema2xml.py	2009-10-01 12:58:34 UTC (rev 104679)
+++ z3c.schema2xml/branches/combined-deserialization-errors/src/z3c/schema2xml/_schema2xml.py	2009-10-01 13:22:02 UTC (rev 104680)
@@ -29,7 +29,7 @@
     """Deserialization did not succeed.
 
     The attribute `field_errors` contains a dictionary mapping each field for
-    which an exception occured to the corresponding exception.
+    which an exception occured to the corresponding exception and element.
 
     """
 
@@ -45,8 +45,8 @@
         try:
             value = IXMLGenerator(field).input(element)
             field.set(instance, value)
-        except Exception, e:
-            errors[field] = e
+        except Exception, v:
+            errors[field] = (v, element)
 
     if errors:
         raise DeserializationError(errors)



More information about the checkins mailing list