On Mon, Sep 22, 2008 at 3:49 PM, Richard Schneeman
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:>
> Is it possible to have error handling or error tolerances inside of a
> ruby controller?
>
> So when my lucene java server has a hiccup and causes my Acts_As_solr
> search to quit working, i can use good old fashioned .find. For example:
>
>
> @phrase = Phrase.find_by_solr("search_term")
>
> if error
> @phrase = Phrase.find(:first, :conditions =>
{"search_term"})
> end
>
>
>
Yes, you can use rescue[1] to do this. You''ll need to track down the
exception that is being thrown and rescue the application.
[1] http://phrogz.net/ProgrammingRuby/tut_exceptions.html
Good luck!
Cheers,
Robby
--
Robby Russell
Chief Evangelist, Partner
PLANET ARGON, LLC
design // development // hosting
http://www.planetargon.com/
http://www.robbyonrails.com/
aim: planetargon
+1 503 445 2457
+1 877 55 ARGON [toll free]
+1 815 642 4068 [fax]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---