[Nitro] Road To Perdition, or: Fixme status

Jonathan Buch john at oxyliquit.de
Sat Aug 19 05:24:04 EDT 2006


> Interesting,
> I didn't know that rescue Object was so problematic. But from your
> email I do not understand the proposed solution. Can you elaborate?

Proposed solution is to be evaluated on a case by case study on each of  
those requires.  The basic approach would be:  Either identify the errors  
that should be thrown and replace `Object` with those Errors or remove the  
rescue since it makes no sense anyway.

An example:

   require 'postgres'
rescue Object => ex # FIXME: don't use Object to rescue!
   Logger.error 'Ruby-PostgreSQL bindings are not installed!'
   Logger.error ex

When the Postgresql aren't installed, how is the application going to  
work?  So:

   require 'postgres'
rescue LoadError => ex
   Logger.error 'Ruby-PostgreSQL bindings are not installed!'
   exit # or `raise` ?

Otherwise the Log-statement could've been untrue.  It might have been that  
there is a syntactical error in the postgres gem, but we will never know...


Uh, btw, I made a little mistake while producing those TODOs:  It regards  
`gmosx:` comments as todos as well.  Not sure about those, I made that  
change to the TextMate TODO-generator quite some time ago...  So, the TODO  
list is probably a bit shorter than it appeared now.  Sorry ^^;

Feel the love

More information about the Nitro-general mailing list