How can i process errors generated by rack-throttle gem when rate limit is excedeed? Now i just get a response containing the following:
Internal Server Error
undefined method `each' for "403 Forbidden (Rate Limit Exceeded)\n":String
Here is the stack trace
ERROR NoMethodError: undefined method `each' for "403 Forbidden (Rate Limit Exceeded)\n":String
/home/rkapitonov/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/query_cache.rb:45:in `each'
/home/rkapitonov/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:458:in `each'
/home/rkapitonov/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.6/lib/rack/body_proxy.rb:23:in `method_missing'
/home/rkapitonov/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/rack/content_length.rb:26:in `call'
/home/rkapitonov/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/rack/log_tailer.rb:14:in `call'
/home/rkapitonov/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.6/lib/rack/handler/webrick.rb:59:in `service'
/home/rkapitonov/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/home/rkapitonov/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/home/rkapitonov/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
How can i process this error and render some custom file or make a redirect?
class Rack::Throttle::Limiter
in an initializer file, like rack_throttle.rb – Bath