From: "Ara.T.Howard" Date: 2004-07-16T01:32:18+09:00 Subject: Re: Hiding app.run in begin-rescue block: pros & cons? On Thu, 15 Jul 2004, Richard Lionheart wrote: > Hi All, > > I apologize for not testing the two approaches myself before posting the > question. My take on this now is: > > Use begin-rescue when code is released for production, because it prevents > a "blizzard" of trace-back messages which would dismay users. > > Use plain app.run when in development mode, because the trace-back is > generally helpful. > > Anyone have other ideas? > > Regards, > Richard require 'logger' logger = Logger.new STDOUT .... .... begin app.run rescue Exception => e logger.debug{ e } logger.fatal{ 'application failed' } end print stack trace only when debugging, give users the ability to turn debugging on with a command line switch. -a -- =============================================================================== | EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov | PHONE :: 303.497.6469 | A flower falls, even though we love it; | and a weed grows, even though we do not love it. | --Dogen ===============================================================================