hi james, thanks for your reply. catching exceptions like that makes
sense. however, the problem is that an exception might be thrown not
only when performing a search, but whenever a model is deleted. (since
the daemon is contacted whenever an indexed model is deleted) this
means that major stuff might have gone wrong, and just rescuing in the
application controller won't fix that.



On Oct 20, 1:20 am, James Healy <[EMAIL PROTECTED]> wrote:
> EmilTin wrote:
> > i'm considering patching my copy of ts so i would get get warnings
> > (perhaps by email) instead of exceptions if the search daemon can't be
> > reached when deleting/changing models.
>
> This is how I handle sphinx connection errors. I have the following in
> my application controller:
>
>   rescue_from ThinkingSphinx::ConnectionError, :with => 
> :sphinx_connection_error
>
>   # method for handling the Sphinx daemon being unavailable. We don't
>   # want to let it filter through to the default 500 page, as it isn't
>   # a major issue, and can be easily fixed.
>   def sphinx_connection_error
>     ...
>     <email code here>
>     ...
>     render :template => 'errors/sphinx_connection', :status => 500
>   end
>
> -- James Healy <jimmy-at-deefa-dot-com>  Mon, 20 Oct 2008 10:16:09 +1100
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/thinking-sphinx?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to