handle JSON parsing errors

This should fix the db:migrate problems you encountered when reviewing PR #117