trap exceptions in management command
Merge pull request #1631 from dimagi/cz

trap exceptions in management command