From: Eloy D. <elo...@gm...> - 2008-05-19 17:35:05
|
Hi Pim, Ideally you'd want to rescue it in #rbValueForKey, something like: class ProjectProxy def rbValueForKey(key) super rescue ActiveRecord::StatementInvalid => e # that's apparently what it raises for a lost connection # do some reporting and reconnect or what have you not... puts e.message puts e.backtrace end end If this gives the desired result and you come up with a good universal solution don't mind to send a patch ;) Cheers, Eloy On 19 mei 2008, at 19:11, Pim Snel wrote: > To be more complete: > > Issue Load (0.000000) Mysql::Error: Lost connection to MySQL server > during query: SELECT id, subject, project_id FROM `issues` WHERE > (issues.project_id = 55 AND status_id < 5) > 2008-05-19 15:43:29.340 TimeToTicket[13026:10b] > ProjectProxy#rbValueForKey: ActiveRecord::StatementInvalid: > Mysql::Error: Lost connection to MySQL server during query: SELECT > id, subject, project_id FROM `issues` WHERE (issues.project_id = > 55 AND status_id < 5) > > But where should I add this begin/rescue/end block? In an overruling > function in ProjectProxy in this case? > > > Op 19 mei 2008, om 17:11 heeft Patrick Geiller het volgende > geschreven: > >> >> >>> Mysql::Error: Lost connection to MySQL server during query. >> >> Is this error thrown by Ruby ? In that case you should be able to >> wrap the offending code with begin / rescue / end. >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by: Microsoft >> Defy all challenges. Microsoft(R) Visual Studio 2008. >> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/_______________________________________________ >> Rubycocoa-talk mailing list >> Rub...@li... >> https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/_______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk |