Error Handeling

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

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