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:
		| @@ -1673,9 +1673,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): | ||||
|   | ||||
		Reference in New Issue
	
	Block a user