jlleblanc / rack_middleware_json_error_msg

Rails middleware to catch JSON parse errors and return error in JSON format

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rails rack middleware to catch JSON parse errors

Put this in your rails app's Gemfile:

gem 'rack_middleware_json_error_msg'

If ActionDispatch::ParamsParser::ParseError gets thrown, it will send back a HTTP 400 response with a JSON-format error message.

About

Rails middleware to catch JSON parse errors and return error in JSON format


Languages

Language:Ruby 100.0%