indigoi
1
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
Ruby 1.8.6, Rails 2.1.0, OSX
indigoi
2
On Mon, Sep 22, 2008 at 3:49 PM, Richard S.
[email protected] wrote:
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] Exceptions, Catch, and Throw
Good luck!
Cheers,
Robby
Robby R.
Chief Evangelist, Partner
PLANET ARGON, LLC
design // development // hosting
http://www.robbyonrails.com/
aim: planetargon
+1 503 445 2457
+1 877 55 ARGON [toll free]
+1 815 642 4068 [fax]