Skip to content

Commit

Permalink
Rescue from JSON::ParserError
Browse files Browse the repository at this point in the history
  • Loading branch information
RickCarlino committed Nov 4, 2019
1 parent 6efe519 commit d5f8c00
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/controllers/api/abstract_controller.rb
Expand Up @@ -33,6 +33,7 @@ class OnlyJson < Exception; end
rescue_from(JWT::VerificationError) { |e| auth_err }

rescue_from(ActionDispatch::Http::Parameters::ParseError) { sorry NOT_JSON }
rescue_from(JSON::ParserError) { sorry NOT_JSON }

rescue_from(ActiveRecord::ValueTooLong) do
sorry "Please use reasonable lengths on string inputs"
Expand Down

0 comments on commit d5f8c00

Please sign in to comment.