From: Brian Candler Date: 2010-04-07T00:56:17+09:00 Subject: Re: Custom Exceptions Chris Hulan wrote: > The default Exception:initialize is defined to take 1 parameter, a > string containing the error message But 'raise' also lets you pass an error message, in addition to the exception instance. Note that even the default constructor doesn't create an instance variable called @message. class Foo < StandardError end begin raise Foo, "bar" rescue Foo => e p e p e.instance_variables p e.instance_variable_get(:@message) p e.message p e.backtrace end # [] # << No instance variables! nil # << No @message! "bar" ["ert.rb:5"] -- Posted via http://www.ruby-forum.com/.