On Mon, Feb 21, 2011 at 4:31 AM, Robert Klemme > Is it really that
common? =A0It may seem so on first sight but I can't
> remember having ever felt the need for this in Ruby. =A0This may have to
> do with my usage patterns of the language but I feel that you usually
> deal with exceptions only by either logging the message or rolling
> back some other code's work.

Libraries which throw away the original exception and substitute their
own have caused me no end of grief. I recommend introducing an
"original" attribute in library exception classes which can be used to
point to the original exception that was replaced. It is even possible
to automatically populate this attribute:

  class MyError < StandardError
    attr_reader :original
    def initialize(msg, original=3D$!)
      super(msg)
      @original =3D original;
    end
  end

Cheers,

--=20
Avdi Grimm
http://avdi.org