From 872bf5794625a4c5a3388602d31be0d62d5d1e2b Mon Sep 17 00:00:00 2001 From: Vassilii Khachaturov Date: Sat, 16 Nov 2013 17:51:18 +0200 Subject: [PATCH] 7198, 7212: attach invalid date to DateError when Date.set throws during the date fields sanity check validation, it now attaches an (undocumented) .date field to the exception -- proof of concept for 7198 and potentially for 7212 as well --- gramps/gen/lib/date.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gramps/gen/lib/date.py b/gramps/gen/lib/date.py index 942790b24..af7cea24a 100644 --- a/gramps/gen/lib/date.py +++ b/gramps/gen/lib/date.py @@ -1643,9 +1643,10 @@ class Date(object): raise DateError("Invalid year {} passed in value {}". format(original, value)) - except DateError: + except DateError as e: log.debug("Sanity check failed - self: {}, sanity: {}".format( self.to_struct(), sanity.to_struct())) + e.date = self raise def recalc_sort_value(self):