From: Kenichi Komiya Date: 2000-03-14T20:17:13+09:00 Subject: [ruby-list:21421] Re: raise non-Exception object From: matz@netlab.co.jp (Yukihiro Matsumoto) Subject: [ruby-list:21409] Re: raise non-Exception object Date: Tue, 14 Mar 2000 11:40:39 +0900 > まつもと ゆきひろです > > |exceptionを呼んで例外に変換してから例外を発生させるという説明にしてみま > |した。形式や内容に不備がなければ英語版も用意します。 > | > |SignalExceptionの「rescueでは補足できません。」もついでに削ってみました。 > > お願いします。 > 前回の差分はファイル名の付けかたがおかしかったですね。すいませんでした。 今回は他の方々のされているのと同じにしてみたつもりですが・・・ それと、買って出ていおいて言うのも何ですが、格別英語に自信があるわけでは ありません。あしからず。 小宮 kom@t3.rim.or.jp *** ruby-man-1.4-dist/function.html Tue Oct 5 01:05:05 1999 --- ruby-man-1.4/function.html Tue Mar 14 19:49:59 2000 *************** *** 476,481 **** --- 476,488 ---- the position in the source file is assigned to the $@.

+ If the first argument is not an exception class or object, the + exception actually raised is determined by calling it's + exception method (baring the case when the argument is a + string in the second form). The exception method of that + class or object must return it's representation as an exception. +

+

The fail is an alias of the raise.

rand(max) *** ruby-man-1.4-dist/syntax.html Wed Dec 8 10:01:31 1999 --- ruby-man-1.4/syntax.html Tue Mar 14 19:54:54 2000 *************** *** 1622,1627 **** --- 1622,1634 ---- the position in the source file is assigned to the $@.

+ If the first argument is not an exception class or object, the + exception actually raised is determined by calling it's + exception method (baring the case when the argument is a + string in the second form). The exception method of that + class or object must return it's representation as an exception. +

+

The word `raise' is not the reserved word in Ruby. raise is the method of the Kernel module. There is an alias named *** ruby-man-1.4-dist/Exception.html Fri Oct 15 04:24:24 1999 --- ruby-man-1.4/Exception.html Tue Mar 14 19:41:04 2000 *************** *** 29,40 **** --- 29,45 ----

Class Methods:

+
+ exception([error_message = ""])
new([error_message = ""])

Creates a new exception object. The error_message string can be supplied as the optional argument. The default exception handler at top leve, will show this error_message.

+

exception is used internally by + raise. +

Methods:

*************** *** 50,55 **** --- 55,66 ----
"#{sourcefile}:#{sourceline}"
(at top level) +
+
exception
+
+

Return self. This method is used internally by raise. +

message
to_s