Environment
- RAILS 3.1
- Ruby 1.9.1
I have tried in the application_controller
but that doesn't seem to work.
Anything I may be doing wrong?
rescue_from ArgumentError do |exception|
flash.now[:error] = "Arguments for your request are incorrect"
#ExceptionNotifier::Notifier.background_exception_notification(exception).deliver if Rails.env.production?
redirect_to root_url, :alert => exception.message
end
The exceptions I am trying to deal with
A ArgumentError occurred in marketplace#index:
invalid byte sequence in UTF-8
.bundle/gems/ruby/1.9.1/gems/rack-1.4.5/lib/rack/utils.rb:104:in `normalize_params'
or
A ArgumentError occurred in connect#index:
invalid %-encoding (%u2713)
.bundle/gems/ruby/1.9.1/gems/rack-1.4.5/lib/rack/backports/uri/common_192.rb:46:in `decode_www_form_component'