#10200: loaddata command does not raise CommandError on errors
---------------------------+------------------------------------------------
 Reporter:  lgs            |       Owner:  nobody    
   Status:  new            |   Milestone:  post-1.0  
Component:  Serialization  |     Version:  1.0       
 Keywords:                 |       Stage:  Unreviewed
Has_patch:  0              |  
---------------------------+------------------------------------------------
 When there is an error in a fixture being loaded by the command loaddata
 it prints an error description into stderr and them simple return. I think
 it would be better to raise a CommandError instead of simple exiting the
 handle method. My reasons are:

   - You can't easily know the succesfullnes of a loaddata command
 programmatically. For example, we have a buildbot that load some fixtures
 and we don't know if it passes this step or not since the exit code is
 always 0 no matter the data is successfully loaded or not.
   - AFAIK is the standard Django mechanism to report command errors
   - The code that catch this type of exceptions does already print its
 message to stderr, so we do not lose that functionality.

 I'm attaching a patch that fixes this issues with existing tests already
 fixed.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/10200>
Django <http://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