A Rack middleware for catching JSON parse errors and providing friendlier messages, all packaged up as a handy Railtie.
Credit to @djcp at thoughtbot for the original code as taken from this blog post.
Add this line to your application's Gemfile:
gem 'catch_json_parse_errors'
And then execute:
$ bundle
Or install it yourself as:
$ gem install catch_json_parse_errors
- Write tests
- Support Rails < 4.0
- Fork it ( http://github.com//catch_json_parse_errors/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request