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
This commit is contained in:
Vassilii Khachaturov 2013-11-16 17:51:18 +02:00
parent 83c6788d43
commit 872bf57946

View File

@ -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):