chippy chippy
2008-Jun-16 23:02 UTC
[Facebooker-talk] how/where to rescue TooManyUserActionCalls on mini feed
Hello, I''ve a little app up and running, and have only come across this error a couple of times, but would like to rescue it to be able to fail gracefully. Testing to see if this could work would be problematic as once I''ve hit the limit, I have to wait a few hours to try again!, so I''m asking your advice :) The relevant bits of code is based on: http://apps.facebook.com/facebooker_tutorial/messaging/mini_feed my attempt: def mini_feed strength begin @userF = session[:facebook_session].user profile_url = "http://www.facebook.com/profile.php?id=" + @userF.uid FacebookPublisher.deliver_mini_feed(facebook_session.user, strength) rescue Facebooker::Session::TooManyUserActionCalls flash[:notice] = "<p>Whoops, you''ve reached the limit for adding news items today, try again tomorrow.<p>" else flash[:notice] = "<p>Great stuff! a news item with the results has been added to your mini feed.<p>" end end Does this seem ok? Or should I be rescuing it in the facebook_publisher.rb class, or in the controller method that calls mini_feed() ? many thanks! Tim