[Nitro] transaction exception logging

George Moschovitis george.moschovitis at gmail.com
Mon Dec 26 05:31:55 EST 2005


Ok, will consider this, any other opinions?

-g.

On 12/23/05, Tim Larson <tim at keow.org> wrote:
> In og/lib/og/store.rb "def transaction", why is there all
> that logging code present?  It make it harder to find the
> error location than a simple rollback and re-raising of
> the exception would.  Also it makes test case output for
> expected failures be unnecessarily verbose and redundant,
> and the lack of re-raising the exception makes it difficult
> to test when and if the right exceptions are being raised
> by the code being tested.
>
> I am recommending:
>
>   def transaction(&block)
>     begin
>       start
>       yield(self)
>       commit
>     rescue => ex
>       #Logger.error 'Erro
>       #Logger.error ex
>       #Logger.error ex.ba
>       rollback
>       raise ex
>     end
>   end
>
> --Tim Larson
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general
>


--
http://www.gmosx.com
http://www.navel.gr
http://www.nitrohq.com




More information about the Nitro-general mailing list