A Rack middleware for catching JSON parse errors and providing friendlier messages.
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
.gitignore
Gemfile
LICENSE.txt
README.md
Rakefile
catch_json_parse_errors.gemspec

README.md

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

  1. Fork it ( http://github.com//catch_json_parse_errors/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request