Hi,
In message "Re: [ruby-core:22698] Re: [Bug #1248] e.exception(e) returns self"
on Fri, 6 Mar 2009 16:52:47 +0900, Tomas Matousek <Tomas.Matousek / microsoft.com> writes:
|Well the reason is that arg is supposed to be a message, right? A message can be an arbitrary object. So if I pass e as a message, why it doesn't become a value of the message property?
The arg is supposed to be an exception, or exception class, or a
message, which means arg is a message only when arg is a string. The
whole purpose of exception method is to duck-type raise semantics,
that is
raise ExceptionClass # specifying exception class
to make a new exception, and
raise anException # specifying exception object
to re-raise the exception.
matz.