CatchJsonParseErrors
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.
Installation
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
TODO
- Write tests
- Support Rails < 4.0
Contributing
- 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