#12467: More helpful error message when loading fixture with invalid date
--------------------------------------+------------------------------------
     Reporter:  knutin                |                    Owner:  raulcd
         Type:  New feature           |                   Status:  assigned
    Component:  Core (Serialization)  |                  Version:  SVN
     Severity:  Normal                |               Resolution:
     Keywords:                        |             Triage Stage:  Accepted
    Has patch:  1                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  0
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------

Comment (by julien):

 That's a good question. One way would be to purposely trigger exceptions
 while the module is loaded to gather all the various error messages from
 `datetime.datetime()`, but that feels dirty... This is also dangerous as
 there's no guarantee that the messages will be the same on every version
 of Python.

 The most complete way would be for Django to do the same tests as
 `datetime.datetime()` and then provide its own messages. However, this
 wouldn't be very robust and would be annoying to maintain.

 Perhaps the safest way is to simply not give any granular error message
 and just say that it's an invalid date, as suggested in the new patch
 attached.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/12467#comment:7>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to