From: Avdi Grimm Date: 2011-02-22T00:19:07+09:00 Subject: Re: Does Ruby support exception wrapping (exception chaining)? On Mon, Feb 21, 2011 at 4:31 AM, Robert Klemme > Is it really that common?  It may seem so on first sight but I can't > remember having ever felt the need for this in Ruby.  This 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=$!) super(msg) @original = original; end end Cheers, -- Avdi Grimm http://avdi.org